How to not print a report if there is no data

nrego

Registered User.
Local time
Today, 08:03
Joined
Jul 27, 2012
Messages
14
I created a button to automatically print a report once clicked. Can I have it not print if there is no data? I have attached the image of the macro I used for the onClick event.
 

Attachments

  • Print Report.JPG
    Print Report.JPG
    18.9 KB · Views: 101
The normal method is having

Cancel = True

In the no data event of the report. That also requires error trapping in the code that opens the report. I'm not sure how to do either with macros though. If you want to stay with the macro, you could add a condition and use DCount() to test the report's record source.
 

Users who are viewing this thread

Back
Top Bottom