Print Page | Close Window

NoDataInReports.mdb (beginner)

Printed From: Roger's Access Library
Category: Roger's Access Library
Forum Name: Roger's Download Samples
Forum Description: A compendium of Microsoft Access 97 and 2000+ routines, each separated into its own sample database.
Printed Date: 23 Sep 2020 at 11:18am
Software Version: Web Wiz Forums 12.03 -

Topic: NoDataInReports.mdb (beginner)
Posted By: Roger Carlson
Subject: NoDataInReports.mdb (beginner)
Date Posted: 30 Jul 2008 at 10:47pm

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


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

Consider donating $1 per sample downloaded," rel="nofollow - find out why here .<

Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.03 -
Copyright ©2001-2019 Web Wiz Ltd. -