> 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
[quoted text clipped - 4 lines]
>
> 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

Signature
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail