Roger's Access Library Homepage
Forum Home Forum Home > Roger's Access Library > Roger's Download Samples
  New Posts New Posts RSS Feed - NoDataInReports.mdb (beginner)
  FAQ FAQ  Forum Search   Events   Register Register  Login Login


Please consider donating $1 per sample downloaded, (find out why here)

NoDataInReports.mdb (beginner)

 Post Reply Post Reply
Author
Message Reverse Sort Order
Roger Carlson View Drop Down
Microsoft MVP
Microsoft MVP


Joined: 20 Feb 2008
Status: Offline
Points: 249
Post Options Post Options   Thanks (0) Thanks(0)   Quote Roger Carlson Quote  Post ReplyReply Direct Link To This Post Topic: NoDataInReports.mdb (beginner)
    Posted: 30 Jul 2008 at 10:47pm

Please consider donating $1 per sample downloaded, find out why here.
 

NoDataInReports.mdb

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.
 
Download
Access 97 (18 KB):
uploads/5/NoDataInReports97.zip
Access 2000 DAO (25 KB): uploads/5/NoDataInReports2k.zip

Consider donating $1 per sample downloaded, find out why here.<
Back to Top
Sponsored Links


Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down