Report Printing

G

Guest

I'm sure this has been answered before, but I was unable to glean the answer
from the archives.

I'm having a problem with reports where after the report is opened in
Preview mode, the code continues to run. Is there a setting that will stop
the code until the report has been closed?

Second, and this may resolve the first issue, is it possible to open the
report in Preview and then call the Print Dialog, to allow the user to select
the quantity to print? I would think, in this case, the code breaks until
the Print Dialog is closed. But I may be mistaken.

Thanks, in advance.

Sharkbyte
 
F

fredg

I'm sure this has been answered before, but I was unable to glean the answer
from the archives.

I'm having a problem with reports where after the report is opened in
Preview mode, the code continues to run. Is there a setting that will stop
the code until the report has been closed?


What code? What does it do?

You can open the report in acDialog (Access 2000 or newer).
DoCmd.OpenReport "ReportName", acViewPreview, , , acDialog
But then you must close the report before anything else happens.
Second, and this may resolve the first issue, is it possible to open the
report in Preview and then call the Print Dialog, to allow the user to select
the quantity to print? I would think, in this case, the code breaks until
the Print Dialog is closed. But I may be mistaken.

Thanks, in advance.

Sharkbyte

You can use the SelectObject method along with the PrintOut method to
select either a report already open in preview or not open along with
the PrintOut method to display select how many copies to print:

To print a report not open:

DoCmd.SelectObject acReport, "ReportName",True
DoCmd.PrintOut , , , , InputBox("How many Copies?",,1)

To print a report already opened in Preview:

DoCmd.OpenReport "ReportName", acViewPreview
DoCmd.SelectObject acReport, "ReportName", False
DoCmd.PrintOut , , , , InputBox("How many Copies?",,1)

Note: The above uses an InputBox for quantity selection.
I would suggest an unbound control on the form instead.
Refer to the form control using:

DoCmd.PrintOut , , , , Me.ControlName
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top