Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Print a report in Access

Posted on 2013-01-22
4
552 Views
Last Modified: 2013-01-22
Dear Experts, can i print an access report without opening it?
I have a report with one input parameter, now it is printing after open the report.(right click on report then print).
But the user need to print it directly by clicking on a command button - without opening the report and without give the in put parameter.
Please give me some good ideas.
Thanks
0
Comment
Question by:gtmathewDallas
4 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 450 total points
ID: 38806240
try using  DoCmd.PrintOut

DoCmd.PrintOut [printrange][, pagefrom, pageto][, printquality][, copies][, collatecopies]


DoCmd.SelectObject acReport, "nameofreport", True

DoCmd.PrintOut , , , , 2  'will print two copies of the report
0
 
LVL 77

Assisted Solution

by:peter57r
peter57r earned 50 total points
ID: 38806391
"I have a report with one input parameter"

Then you have to supply the parameter value.  You can't miss this out.

If you don't want to supply a parameter value you have to remove the parameter from the report's recordsource.
0
 
LVL 61

Expert Comment

by:mbizup
ID: 38806516
Use a form with a textbox for the user to specify the criteria parameter and a command button to print the report.

Change the report's recordsource to read the parameter from the form ... something like this (for example purposes, I'm assuming a date field for the parameter):

SELECT * FROM YourTable WHERE YourDateField = Forms!YourFormName!txtYourTextboxName

Open in new window

The code behind the command button to send the report directly to the printer (without opening it in preview):

Docmd.OpenReport "YourReportName", acViewNormal

Open in new window

0
 

Author Closing Comment

by:gtmathewDallas
ID: 38806547
Thanks Capricon...Its a good solution..Thanks Peter and Mbizup
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Office Picture Manager is not included in Office 2013. This comes as a shock to users upgrading from earlier versions of Office, such as 2007 and 2010, where Picture Manager was included as a standard application. This article explains how…
Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question