Report goes to printer instead of preview---

P

prosfora

I created a dialog box that generates a report (based on a query) after
selecting from the combo box and clicking the OK button. However, the report
goes straight to the printer instead of displaying on the screen.

How can I get the report to preview first, with the option to print it or
close it?

Would greatly appreciate help! (thank you)----
 
D

Douglas J. Steele

No doubt your existing code has something like:

DoCmd.OpenReport "MyReportName"

When you don't provide a second argument, that defaults to printing the
report.

Pass it acViewPreview as an argument, and you should get what you're looking
for:

DoCmd.OpenReport "MyReportName", acViewPreview
 
P

prosfora via AccessMonster.com

Douglas said:
No doubt your existing code has something like:

DoCmd.OpenReport "MyReportName"

When you don't provide a second argument, that defaults to printing the
report.

Pass it acViewPreview as an argument, and you should get what you're looking
for:

DoCmd.OpenReport "MyReportName", acViewPreview
I created a dialog box that generates a report (based on a query) after
selecting from the combo box and clicking the OK button. However, the
[quoted text clipped - 5 lines]
Would greatly appreciate help! (thank you)----

Thanks very much Doug - this works!!!
 

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