Charlotte Foust
cfoust at infostatsystems.com
Thu Aug 14 10:53:44 CDT 2003
You can trap an error 2501, which is what will be returned to the calling routine but that will only tell you it has been cancelled, not why. You could raise a custom event from the report and sink it in the calling form. That would let the report tell you why it was cancelled. Charlotte Foust -----Original Message----- From: Susan Geller [mailto:sgeller at cce.umn.edu] Sent: Thursday, August 14, 2003 7:35 AM To: accessd at databaseadvisors.com Subject: [AccessD] How to evaluate if report was cancelled due to no data XP. I have a form that opens a report. In the report, I have: Private Sub Report_NoData(Cancel As Integer) MsgBox "There are no data to display for the criteria you selected.", vbOKOnly, "DataMart" Cancel = True End Sub All's well. PROBLEM: The report cancels, and it goes back to the line right after the open report line of code. At that point, I want to evaluate to see if the report was cancelled so that I can do one thing if it was cancelled due to no data and do something else if it wasn't. How can I do this? --Susan Susan B. Geller Office of Information Systems College of Continuing Education University of Minnesota 306 Wesbrook Hall 77 Pleasant Street SE Minneapolis, MN 55455 Phone: 612-626-4785 Fax: 612-625-2568 _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com