Don't print if no data

ralphyehle

Registered User.
Local time
Today, 03:55
Joined
Aug 28, 2002
Messages
22
How do I keep from printing reports that do not contain any data? I don't see the report, just send it to the printer and if it contains no data I'd rather not print it. Isn't there a simple setting to restrict printing blank reports? I am running the four reports using a macro.

I print 4 reports for each county (27 counties) if their was no action in the county all four reports are printed with no data. It is also possible for a county to have data in the first report but not the last three.
 
Last edited:
In the report's properties sheet, under the events tab, create a new event procedure for the "On No Data" event. Put something like this in the sub that is produced in the code window:

Code:
Private Sub Report_NoData(Cancel As Integer)
    [B]Cancel = True
    MsgBox "The print action was canceled...the report contained no data"[/B]
End Sub
 
this works

thanks for the help!
 

Users who are viewing this thread

Back
Top Bottom