Calling a printer selection dialog box b4 printing a report

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
 
R

Ron Hinds

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.
 
V

Van T. Dinh

.... 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.
 
B

Bob

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
 
A

Allen Browne

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
 
M

mmellring

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
 
Top