Hi all,
I am using MSAccess 03, win xp.
I have a report form with this option button that runs this bit of code to open the report:
ElseIf [Forms]![Reports Form]![fReportOptions].Value = 9 Then
DoCmd.OpenReport "Cancel Report A", acViewPreview
I added this bit of code to the On NoData Event to let the user know when there are no records, but when I click the Option button and put in the date parameters I get the message no problem, but then another window with a Runtime error 2501 and it asks me to Debug. How do I get that Error message to not show up?
Private Sub Report_NoData(Cancel As Integer)
On Error GoTo ErrorHandler
MsgBox "There are currently no records in that timeframe", vbOKOnly, "No Records"
Cancel = True
ExitHandler:
Exit Sub
ErrorHandler:
MsgBox Err.Description
Resume ExitHandler
End Sub
I am using MSAccess 03, win xp.
I have a report form with this option button that runs this bit of code to open the report:
ElseIf [Forms]![Reports Form]![fReportOptions].Value = 9 Then
DoCmd.OpenReport "Cancel Report A", acViewPreview
I added this bit of code to the On NoData Event to let the user know when there are no records, but when I click the Option button and put in the date parameters I get the message no problem, but then another window with a Runtime error 2501 and it asks me to Debug. How do I get that Error message to not show up?
Private Sub Report_NoData(Cancel As Integer)
On Error GoTo ErrorHandler
MsgBox "There are currently no records in that timeframe", vbOKOnly, "No Records"
Cancel = True
ExitHandler:
Exit Sub
ErrorHandler:
MsgBox Err.Description
Resume ExitHandler
End Sub