Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print report if is not blank

Status
Not open for further replies.

tdbeargrrl

Programmer
Feb 26, 2002
10
US
I am trying to limit the number of buttons on the switchboard and make this easier to use for a very novice user. I want to have one button that prints all the reports that have been compiled during the day. If the report does not have any data in it I don't want it to print. Is there a way to do this? Each report pull from its own query - so if the query were empty the report would also be empty.
 
I normally do it like this....

In the NoData event for each report put:

Private Sub Report_NoData(Cancel As Integer)
Cancel = True
End Sub

On Error Resume Next
DoCmd.OpenReport sReportName
' Trap system no data event
If Err = 2501 Then
Err.Clear
MsgBox sReportName + " has no data..."
End If
On Error GoTo WhereIWentBefore
Good Luck,
Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top