Back-to-Back DoCmd.OpenReport fails if Printer Offline

  • Thread starter Help with Multi Catalog
  • Start date
H

Help with Multi Catalog

I have discovered that this fails:
private sub DoListAndReceipt()
DoCmd.OpenReport ...
DoCmd.OpenReport ...
end sub
when my Printer is Offline.

The first OpenReport executes and makes it to the Printer Queue.
The second OpenReport does not execute at all.
Execution falls-thru to the "end sub".
Cancelling the first report in the queue does no good.

I have traced, trapped, etc., but to no avail.
The printer offline aborts the second DoCmd.OpenReport.

The application is in Access 2003 with a 2000 mdb format.

Does anyone have a "solid" means of retrieving the Printer Offline status
-or-
How the second DoCmd.OpenReport can be executed, despite Printer Offline (at
least the Report will be in the queue)?
 
M

Marshall Barton

Help said:
I have discovered that this fails:
private sub DoListAndReceipt()
DoCmd.OpenReport ...
DoCmd.OpenReport ...
end sub
when my Printer is Offline.

The first OpenReport executes and makes it to the Printer Queue.
The second OpenReport does not execute at all.
Execution falls-thru to the "end sub".
Cancelling the first report in the queue does no good.

I have traced, trapped, etc., but to no avail.
The printer offline aborts the second DoCmd.OpenReport.

The application is in Access 2003 with a 2000 mdb format.

Does anyone have a "solid" means of retrieving the Printer Offline status
-or-
How the second DoCmd.OpenReport can be executed, despite Printer Offline (at
least the Report will be in the queue)?


I know nothing about what may or may not happen when a
printer is "offline", but your example left out a very
important bit of information. If you are opening the same
report in both lines, e.g.

DoCmd.OpenReport "reportA", ...
DoCmd.OpenReport "reportA", ...

then that has always been unlikly to run as you might
expect. If the first one is still running when the the
second one executes (very likely), the second one will just
interfere with the first one, sometimes switching the where
condition in mid steam.

If you are opening two different reports, e.g.

DoCmd.OpenReport "reportA", ...
DoCmd.OpenReport "reportB", ...

Then I could only guess that the problem would be more
closely related to the print spooler than the printer's
status.
 

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