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

Christopher Hawkins clh at christopherhawkins.com
Fri Aug 15 13:50:54 CDT 2003


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-



More information about the AccessD mailing list