Printer Dialog

S

Samantha

I currently use an icon on the form to print the report directly to the
default printer. But because there are so many printers, not all users want
to use their default printer. I want to automatically bring the printer
dialog (the standard one that we see in Office) and let the user choose which
one, instead of sending it to the printer directly using the following code:

DoCmd.OpenReport stDocName, acNormal, "rptRMA"

Is there a way to open the Dialog box without having to go to Print Preview
first? Any help is very much appreciated.

Samantha
 
A

Allen Browne

Does this approach do what you need:

DoCmd.OpenReport stDocName, acViewPreview
RunCommand acCmdPrint
 
S

Samantha

This works great! Thanks Allen.

Just for my curiosity, is there a way to open the Printer Dialog box without
opening the report in Print Preview mode?

Thanks again.
Samantha
 
A

Allen Browne

The 2nd line will open the print dialog, but it prints the active object. So
if you don't open the report first, you will print something else, such as a
switchboard form.

An alternative approach might be to code a custom property for the report so
it remembers the printer that the user wants for that report. You can then
set the Printer object before you OpenReport, and it goes to the printer the
user wants. Details in:
Printer Selection Utility - Users assign printers to reports
at:
http://allenbrowne.com/AppPrintMgt.html
 

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

Similar Threads


Top