No data event

  • Thread starter Thread starter jln via AccessMonster.com
  • Start date Start date
J

jln via AccessMonster.com

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?
 
jln said:
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?


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
 
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
 
Back
Top