By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,694 Members | 1,847 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,694 IT Pros & Developers. It's quick & easy.

What to do with an empty query in a report?

P: n/a
I have a report that runs on a parameter query. I run the report, enter the
parameter, and it works as long as there is at least one record returned by
the query. But if it comes up empty, I get an error in the report. I think
there is some way to query the query to see if it's got any records and then
exit the report. How is this done?

Robert
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Robert wrote:
I have a report that runs on a parameter query. I run the report, enter the
parameter, and it works as long as there is at least one record returned by
the query. But if it comes up empty, I get an error in the report. I think
there is some way to query the query to see if it's got any records and then
exit the report. How is this done?

Robert


See if setting the event procedure for the Report's OnNoData event to
something will help. Ex:

Private Sub Report_NoData(Cancel As Integer)
msgbox "Nothing to report"
Cancel = True
End Sub

Nov 12 '05 #2

P: n/a

Perfect! Thanks.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.