Error of Printer is uninstalled

  • Thread starter Thread starter Sanjay Singh
  • Start date Start date
S

Sanjay Singh

I am using Access VBA (Access 97) to preview and print reports. I am having
the following error that I hope someone can assist with.

If the user has set the report to a "specific printer" and then the printer
is later uninstalled, the VBA code (Docmd.OpenReport) gives an error and is
unable to display the report.

Even going into design mode of the report through the database window gives
an error that the printer cannot be found. Setting the printer manually to
the default printer then makes it work again.

Is there any way in making sure from VBA that the report still opens, maybe
changing its printer to the default printer.

Thanks in advance.

Sanjay Singh
 
Yes, if you assign the report to a specific printer, and that printer driver
is no longer available, you do receive a warning message and Access
typically offers to reformat it for your default printer.

To reassign the report to a different printer programmatically in Access 97,
see:
Reports: Change printers from code
at:
http://www.mvps.org/access/reports/rpt0009.htm

In Access 2002 or later, you can assign the Printer from the Printers
collection.
 
Back
Top