prevent report from printing if no data exists

b9791

Brian
Local time
Today, 08:05
Joined
Jul 30, 2002
Messages
29
The startup form in my database triggers a macro to run that prints a report, then closes the form and opens the Switchboard. The report that prints is a report that shows pending unshipped urgent orders. But the only current problem is is that I don't always have urgent pending orders. How do I keep the report from printing if there is no data to print?

Brian
 
You can use the On No Data event of your report

Private Sub Report_NoData(Cancel as Integer)

MsgBox "No Data To Print", vbCritical, "No Data"
Cancel = True

End Sub
 
Thank you! That worked beautifully.
 

Users who are viewing this thread

Back
Top Bottom