Printer Dialog

  • Thread starter Thread starter Samantha
  • Start date Start date
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
 
Does this approach do what you need:

DoCmd.OpenReport stDocName, acViewPreview
RunCommand acCmdPrint
 
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
 
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
 
Back
Top