"How can I prevent a report from printing if there isn't any data?"

In the OnNoData event, add this:

MsgBox("There is no data for this report.")
Cancel = True

And the code that opens the report should look like this:

On Error Resume Next
DoCmd.OpenReport "TheReport"

This will prevent an 'Action Was Cancelled' message.