NoDataInReports.mdb (beginner)

Please consider donating $1 per sample downloaded, find out why here
Download
NoDataInReports.zip
Access 97 (18 KB)

This sample illustrates how to cancel a report that has no data in it. It uses the OnNoData event of the report. The report "rptGLTable" has the following code in the OnNoData event:

   MsgBox "There is no data for this report"
   Cancel = True

This cancels the report, and the error generated (2051) is trapped in the OnClick event of the Preview report button.

To test, choose 'abc' in the combo box, then choose 'xyz'. There is no 'xyz' data.

 

Feedback

 

Need Winzip?

Return to Main Page