Hi All,
I use the following code in the On No Data event of a report:
Private Sub Report_NoData(Cancel As Integer)
MsgBox "No data exists for the date range entered.", vbInformation, "No Data Alert"
Cancel = True
End Sub
This works fine to cancel the opening of the report however Ms Access annoyingly then pop-ups another alert that reads as follows:
"The OpenReport action was cancelled". There is no error number.
I've tried putting in a DoCmd.Close after Cancel = True however this doesn't do the job.
Does anyone know of a way to prevent the Ms Access pop-up from appearing?
Many thanks!
I use the following code in the On No Data event of a report:
Private Sub Report_NoData(Cancel As Integer)
MsgBox "No data exists for the date range entered.", vbInformation, "No Data Alert"
Cancel = True
End Sub
This works fine to cancel the opening of the report however Ms Access annoyingly then pop-ups another alert that reads as follows:
"The OpenReport action was cancelled". There is no error number.
I've tried putting in a DoCmd.Close after Cancel = True however this doesn't do the job.
Does anyone know of a way to prevent the Ms Access pop-up from appearing?
Many thanks!