Hi!
When a report is run and there are no records, I have a msg box that pops up to advise the user, instead of seeing #Errors on the report.
But in some cases, I am still getting the erro 2501 message.
This is the code I used to try and ignore it (based on searching the problem on various forums), but the err 2501 message still pops up. Can someone tell me how to correct this code?
Private Sub Report_NoData(Cancel As Integer)
On Error GoTo MyError
MsgBox "There are no expenses entered for those dates.", vbInformation, "No Data"
Cancel = True
MyExit:
Exit Sub
MyError:
If Err.Number = 2501 Then GoTo MyExit
MsgBox Err.Description
GoTo MyExit
End Sub