Full Version: Report with empty record set
UtterAccess Discussion Forums > Microsoft® Access > Access Reports
CHKarcher
Know that I have done this before - in the call code for a report - If the query for the report is empty - how do I make it not display the report and give empty set msgbox

thanks
steve
Steve Schapel
Steve,

You mean something like this?...

If DCount("*","MyQuery") > 0 Then
DoCmd.OpenReport "MyReport"
Else
MsgBox "No matching data"
End If
tunkefer
You can alos use the Report_NoData event of the report to cancel the opening of the report and issue your message.
CHKarcher
that was it - thanks
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.