DataBase - Back-to-Back DoCmd.OpenReport fails if Printer Offline
Asked By Help with Multi Catalog
21-Nov-09 07:19 AM
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)?
DoCmd.OpenReport
(1)
Access 2003
(1)
DoListAndReceipt
(1)
Report
(1)
ReportA
(1)
ReportB
(1)
Spooler
(1)
Aborts
(1)
Marshall Barton replied to Help with Multi Catalog
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.
--
Marsh
MVP [MS Access]
report? e.g. the code below opens all reports at the same time Sub RunReports() DoCmd.OpenReport "ReportA", acViewPreview DoCmd.OpenReport "ReportB", acViewPreview DoCmd.OpenReport "ReportC", acViewPreview DoCmd.OpenReport "ReportD", acViewPreview End Sub Access Modules DAO Discussions CurrentProject.AllReports (1) DoCmd.OpenReport (1) Access
Access 2003 reports with parameters and VB 6.0 DataBase Hi, All I am using VB 6.0 front end and Access 2003 is back end, i created queries with parameters and reports (data source are those queries from VB application, i can print reports w / o parameters like this: Set objAccess = New Access.Application With objAccess .DoCmd.OpenQuery strDB, acViewPreview, acReadOnly .OpenCurrentDatabase (strDB) .DoCmd.OpenReport strReportName .DoCmd.Close acReport, strReportName .Application.CloseCurrentDatabase End With If Not objAccess Is Nothing Then reports from VB and reports data source are queries (saved in db) with parameters in Access 2003. Access Reports Discussions ObjAccess (1) VB (1) CloseCurrentDatabase (1) OpenCurrentDatabase (1) StrReportName (1) DoCmd
Parameter range in DoCmd.OpenReport DataBase Bear with me, I'm really new to this. I'm setting up a form in Access 2003 where a user would select a start year and an end year to open a This is the code that I've attached to a command button on the form: DoCmd.OpenReport "Jobs by Sales Rep (all)1", acViewPreview, , "[Fiscal Year] What is wrong with it? Thanks, Jim Access Modules DAO Discussions DoCmd.OpenReport (1) Access 2003 (1) Report (1) JimAA (1) AcViewPreview (1) Rep (1) Year (1
Access 2000 OpenReport arguments DataBase I am developing with Access 2003. I have some users that are still on Access 2000. Can someone tell me the arguments for Access 2000 for OpenReport and how they are different then Access 2003? I know you use acNormal instead of acViewNormal for 2nd argument. And I guess there just too hard to find documentation for the old version. Thanks ahead of time. Arep Access Reports Discussions DoCmd.OpenReport (1) Access 2003 (1) AcFormDS (1) AcViewNormal (1) AcFormView (1) WindowMode