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.
URL: www.rogersaccesslibrary.com/forum/forum_posts.asp?TID=313
Printed Date: 28 Mar 2024 at 1:40pm
Software Version: Web Wiz Forums 12.03 - http://www.webwizforums.com


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, http://www.rogersaccesslibrary.com/whydonations.htm - 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):
http://www.rogersaccesslibrary.com/forum/uploads/5/NoDataInReports97.zip - uploads/5/NoDataInReports97.zip
Access 2000 DAO (25 KB): http://www.rogersaccesslibrary.com/forum/uploads/5/NoDataInReports2k.zip - uploads/5/NoDataInReports2k.zip



-------------
Consider donating $1 per sample downloaded, http://www.rogersaccesslibrary.com/whydonations.htm" rel="nofollow - find out why here .<



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.03 - http://www.webwizforums.com
Copyright ©2001-2019 Web Wiz Ltd. - https://www.webwiz.net