Hale, Jim
Jim.Hale at FleetPride.com
Wed May 23 13:49:32 CDT 2007
I think you need to set cancel=true Private Sub Report_NoData(Cancel As Integer) Dim lngRetval As Long lngRetval = MsgBox( _ "There are no Balances without Assigned Departments", _ vbOKOnly + vbExclamation + vbSystemModal + vbDefaultButton1, _ "Missing Departments") Cancel = True End Sub Jim Hale -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Elam, Debbie Sent: Wednesday, May 23, 2007 11:36 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] OnNoData error I am running a series of reports off of one command button. Some of these may not have data, so I have used the OnNoData event to cancel that particular report and send a message box to the user that there was no data in that one. The problem I am encountering is the standard 2501 error will simply not be suppressed. I have used If err.number = 2501 then resume next Else msgbox err.desctiption resume ExitTheSub End if In the on error of the button that runs the reports. Heck I have even set all errors to resume next, but I still get the error and no resume next. I could even live with a harmless error message, but once this happens, all subsequent reports do not run. That is the real problem. Debbie -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com *********************************************************************** The information transmitted is intended solely for the individual or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of or taking action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you have received this email in error please contact the sender and delete the material from any computer. As a recipient of this email, you are responsible for screening its contents and the contents of any attachments for the presence of viruses. No liability is accepted for any damages caused by any virus transmitted by this email.