How handle query returns no data (In report) ?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

What is the best way to handle the case where a query returns no data.
This is in a report.
THis may heppen because the user can select various filtering criteria that may result in no output.
 
What is the best way to handle the case where a query returns no data.
This is in a report.
THis may heppen because the user can select various filtering criteria that may result in no output.


Use the Report's OnNoData event.

MsgBox "there are no records returned for this report"
Cancel = True.
 
Not necessarily the best, but try...

Private Sub Report_NoData(Cancel As Integer)
'your messagebox
Cancel = True
End Sub


This will raise a "report cancelled" error in the calling
routine, trap and suppress it there.

-----Original Message-----
What is the best way to handle the case where a query returns no data.
This is in a report.
THis may heppen because the user can select various
filtering criteria that may result in no output.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top