When the report has no data to print.
Code the Report's OnNoData event:
MsgBox "There are no records to show in this report"
Cancel = True
The above will give an error if you have opened the report from a
command button event on a form.
Add error handling to the command button event to trap for error 2501.
On Error GoTo Err_Handler
DoCmd.OpenReport "ReportName" etc.
Exit_ThisEvent:
Exit Sub
Err_Handler:
If Err = 2501 then
Else
MsgBox "Error #: " & Err.Number & " " & Err.Description
End If
Resume Exit_ThisSub