Button to print several reports

  • Thread starter Thread starter Alex
  • Start date Start date
A

Alex

Does anyone know some code to put behind a button on a form that will print,
for example, rpt1, rpt2, rpt3, when a user selects a printer from the print
dialog box and clicks the OK button? Currently the print dialog box opens
for each report and I only want it to open once, but print all 3 reports.

I can't indicate the printer in the code because users will be selecting
different printers.

Also, if the cancel button is selected or if the dialog box is closed (and
the OK button not selected), I don't want the reports to print.

Thanks for your help.
 
If you are using Access 2002 or later (2003, or 2007), you could create a
form with a combo box populated from the Printers collection (the DeviceName
of each), so the user can choose one. Your form can then assign the Printer
to this one, and print the report. Then clear the Printer (by setting it to
Nothing) before the form closes.

If you have never used the Printer collection before, download the example
utility in this page:
http://allenbrowne.com/AppPrintMgt.html
The form shows how to load the combo with the printers, and let the user
choose one. The utility then identifies that printer with the report, and
remembers to use it again next time (which is not what you asked for, but
hopefully illustrates how to do it.)
 
Unfortunately, most users are still on Access 2000. I should have mentioned
that. Is there another way I can accomplish this? Thanks Allen.
 
Thanks Chuck. We can't assume that each user will want to print to his/her
default printer so we need to allow them to choose a printer.
 
Back
Top