This looks like an old chestnut but my searches for an answer have failed.
A report opened from the Switchboard has this for no data
It flags up the warning but then brings up the standard Microsoft Visual Basic 2501 run-time error message with End and Debug options, not good for users.
If I take out Cancel = True a blank report opens, which is marginally better.
How do I just abort opening the report after the 'There is no data' warning?
Being driven from a Switchboard the HandleButtonClick event covers all sort of possible responses - open query, form, report, etc. On stepping through the code it never seems to get to its error handler for the no data case.
A report opened from the Switchboard has this for no data
Code:
Private Sub Report_NoData(Cancel As Integer)
MsgBox "There is no data", , "No Data"
Cancel = True
End Sub
It flags up the warning but then brings up the standard Microsoft Visual Basic 2501 run-time error message with End and Debug options, not good for users.
If I take out Cancel = True a blank report opens, which is marginally better.
How do I just abort opening the report after the 'There is no data' warning?
Being driven from a Switchboard the HandleButtonClick event covers all sort of possible responses - open query, form, report, etc. On stepping through the code it never seems to get to its error handler for the no data case.