J
JerryC
I am using Autoexec macro to RunCode that will
automatically print a report when application starts.
This line is in a module.
DoCmd.OpenReport "PMR1", acViewNormal, "PMQAutoPrintDues"
If there is data for the report it prints out OK.
If query for report returns nothing then I use the On No
Data event on the report to show a message.
Private Sub Report_NoData(Cancel As Integer)
MsgBox "There are no records to print", vbOKOnly, "No
report"
Cancel = True
DoCmd.Close acReport, "PMR1"
End Sub
When there is no data for the report I get the
message "There are no records to print" then an error
message saying the Action Failed.
How can I stop the Action Failed message or trap it???
Thanks in advance for your help
automatically print a report when application starts.
This line is in a module.
DoCmd.OpenReport "PMR1", acViewNormal, "PMQAutoPrintDues"
If there is data for the report it prints out OK.
If query for report returns nothing then I use the On No
Data event on the report to show a message.
Private Sub Report_NoData(Cancel As Integer)
MsgBox "There are no records to print", vbOKOnly, "No
report"
Cancel = True
DoCmd.Close acReport, "PMR1"
End Sub
When there is no data for the report I get the
message "There are no records to print" then an error
message saying the Action Failed.
How can I stop the Action Failed message or trap it???
Thanks in advance for your help