Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to print a report and close the report after printing

Status
Not open for further replies.
Mar 27, 2002
168
NL
I have a report:
In the report_open event I have code to open a form
In this form I build the query needed to print the report
(set users, dates and so on)
after closing the form the report is build in preview,
in which event I can set the docmd.printout and docmd.close acreport, "rptName" to print the document programmatically and not by userinteraction
 
The preview option is designed to allow the user to view the report on screen and decide for themselves whether to print.

If you just want to print without the user being involved, change acViewPreview to acViewNormal when you call DoCmd.OpenReport. The report open event can still call your form to get parameters. The report will then print and close.

Ken
 
you;re right, I thought this was impossible, so I haven't try ;)
I now make macros for the report_open acNormal actions
and play this action with buttons on the custombar

Thnx
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top