Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Reports / Printing / April 2007

Tip: Looking for answers? Try searching our database.

No data event

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jln - 17 Jan 2007 15:59 GMT
Im trying to set up a report that will print out another report only when the
first report is blank.

I place a open report macro into the on no data event  of the first report
and get a runtime error of 2212 error when it trys to print the 2nd report
and cancel the first.

What is the best way to get this to work?
Marshall Barton - 17 Jan 2007 19:34 GMT
>Im trying to set up a report that will print out another report only when the
>first report is blank.
[quoted text clipped - 4 lines]
>
>What is the best way to get this to work?

Open the 2nd report from the form command button's error
handler (error 2501).  Here's the general idea:

    On Error GoTo CatchErrors
    DoCmd.OpenReport "report1", . . .

ExitHere:
    Exit Sub

CatchErrors:
Select Case Err.Number
Case 2501
    DoCmd.OpenReport "report2", . . .
Case Else
    MsgBox Err.Number & " - " & Err.Description
End Select
Resume ExitHere
End Sub

Signature

Marsh
MVP [MS Access]

Donnie Ashley - 05 Apr 2007 13:02 GMT
I did not post the question.... however, it is the perfect solution to my
similar problem and I learned about about using Err.Number.  Thanks for the
help!

-Donnie

> >Im trying to set up a report that will print out another report only when the
> >first report is blank.
[quoted text clipped - 23 lines]
> Resume ExitHere
> End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.