Preventing empty reports from printing

C

Chuckwny

I have a button that runs a macro that prints out 5
reports. My problem is that 2 or 3 of these reports are
usually empty. Is there a way to check if a report is
empty before printing?

Thanks

Chuck
 
A

Andrew Smith

Reports have a "no data" event that allow you cancel opening the report and
display a message (or indeed do anything else). eg this will show a message
saying "No data to display" and will prevent the report from opening:

Private Sub Report_NoData(Cancel As Integer)
msgbox "No data to display"
Cancel = True
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top