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.
 
Back
Top