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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Have a "Sorry, no records available" msgbox for reports w/no records

Status
Not open for further replies.

mdweezer

Technical User
Jun 15, 2004
56
US
I'm executing a report via another form, passing it a variable. Based on the variable it spits out a report.

However, is the report is empty and no records are returned, how do I make a message box to say "Sorry, no records available"?

Seems like it should be pretty easy... but i'm stumped.

Is this done on the form before executing the report or on the report itself?
 
I'm such an idiot!!!!!!!!!!!

I didn't see the "No record" event or whatever for the report....

Sorry!
 
Use the reports NoData event as follows:

Private Sub Report_NoData(Cancel As Integer)
MsgBox "No records to report", vbInformation, "Information"
Cancel = True
End Sub

Yakup
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top