Solved

Print a report in Access

Posted on 2013-01-22
4
569 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
[X]
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
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

726 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