Calling a printer selection dialog box b4 printing a report

  • Thread starter Thread starter Bob
  • Start date Start date
B

Bob

How do you show a print selection dialog box, allow the user to select a
printer and then print a report to the selected printer?

Thanks,
Bob
 
Use this code:

DoCmd.OpenReport "your_report_name", acViewPreview

This opens the report in preview mode. Pressing Ctrl-P brings up the
standard Print dialog box, allowing you to choose the printer, layout, etc.
 
.... or you can bring up the Print Dialog automatically using the statement

DoCmd.RunCommand acCmdPrint

after the OpenReport statement in Preview with acWindowNormal or acIcon
mode.
 
Thanks to both of you. But I can't run the report in print preview mode the
customere wants it printed out without previewing it.
I think I need to set the default printer to the selected printer before I
call the report.

Bob
 
In Access 2002 or 2003, you can set the Printer object before you open the
report, e.g.:
Application.Printer = Application.Printers(2)

If you want the report to remember which of the user's printers it should
use for that particular report, see:
Printer Selection Utility
at:
http://allenbrowne.com/AppPrintMgt.html
 
hi bob '' bdufour@sginl .com
Bob said:
Thanks to both of you. But I can't run the report in print preview mode the
customere wants it printed out without previewing it.
I think I need to set the default printer to the selected printer before I
call the report.

Bob
 
Back
Top