[AccessD] On-site emergency! A2K: Error when clicking cance l in report dialog

Drew Wutka DWUTKA at marlow.com
Fri Aug 15 14:08:43 CDT 2003


How about setting opposite dates when they click cancel (ie, the first date
being tomorrow, and the last date being today....thus, no data), then set
Cancel=True in the NoData event of the report.

Drew

-----Original Message-----
From: Christopher Hawkins [mailto:clh at christopherhawkins.com]
Sent: Friday, August 15, 2003 1:51 PM
To: accessd at databaseadvisors.com
Subject: [AccessD] On-site emergency! A2K: Error when clicking cancel in
report dialog


I'm on-site with one of my few remaining clients right now.  I can't
afford to foul this up.

I have a form (frmReport) that presents a list of reports to the user.

Some reports require date ranges, so in the Open event of the report,
I have code (stolen straight) from Northwind that will open the date
range dialog (frmDateRange) modally.  Ordinarily, the user would
enter a date range and click OK, rendering frmDateRange invisible and
allowing the rest of the Report_Open code to fire.

But if the user clicks Cancel in frmDateRange, the code in
Report_Open is supposed to see that frmDateRange is no longer loaded,
set Cancel = True, and close.  And it does - but Access also throws a
2501 error that breaks on the DoCmd.Open Report line from frmReport!

I've tried trapping for error 2501 in frmReport - the procedure
doesn't even make it to the error handling section of the sub; it
just sits there on the DoCmd.OpenReport line.  I don't know what to
do to either avoid throwing thid error (preferable), or managing what
happens after the error is thrown.

And before you ask, I cannot paste code because my client won't let
me.

Heeeeeeeelp...

-Christopher-

_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


More information about the AccessD mailing list