L
Leslie Isaacs
Hello All
I am using A97.
I have a button on a form that, when clicked, brings up two reports. The
on-event code is below. The problem is that I want to stop the error massage
that appears when either report has no data. Both reports have the 'on no
data' event set to Cancel = True, but how do I trap the error. Usually 'If
Err = 2501 Then Err.Clear'
works, but with two reports it doesn't!
Hope someone can help.
Many thanks
Leslie Iaacs
My code:
Private Sub Command674_Click()
On Error GoTo Err_Command674_Click
Dim stDocName As String
stDocName = "rpt P14 try 2004/05"
DoCmd.OpenReport stDocName, acPreview
stDocName = "rpt P14 try dcmonths 2004/05"
DoCmd.OpenReport stDocName, acPreview
If Err = 2501 Then Err.Clear
Exit_Command674_Click:
Exit Sub
Err_Command674_Click:
MsgBox Err.Description
Resume Exit_Command674_Click
End Sub
I am using A97.
I have a button on a form that, when clicked, brings up two reports. The
on-event code is below. The problem is that I want to stop the error massage
that appears when either report has no data. Both reports have the 'on no
data' event set to Cancel = True, but how do I trap the error. Usually 'If
Err = 2501 Then Err.Clear'
works, but with two reports it doesn't!
Hope someone can help.
Many thanks
Leslie Iaacs
My code:
Private Sub Command674_Click()
On Error GoTo Err_Command674_Click
Dim stDocName As String
stDocName = "rpt P14 try 2004/05"
DoCmd.OpenReport stDocName, acPreview
stDocName = "rpt P14 try dcmonths 2004/05"
DoCmd.OpenReport stDocName, acPreview
If Err = 2501 Then Err.Clear
Exit_Command674_Click:
Exit Sub
Err_Command674_Click:
MsgBox Err.Description
Resume Exit_Command674_Click
End Sub