Button to print several reports


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

Advertisements

A

Allen Browne

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.)
 
A

Alex

Unfortunately, most users are still on Access 2000. I should have mentioned
that. Is there another way I can accomplish this? Thanks Allen.
 
Ad

Advertisements

A

Alex

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.
 

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

Top