Default error handling

  • Thread starter gmazza via AccessMonster.com
  • Start date
G

gmazza via AccessMonster.com

Hi there,
I have an Error Handling routine I use in my Subs and Functions and was
wondering if there was anything in Access that I can type my handling into;
then whenever I code under any event, it adds my handling to it automatically
or by default.
Reason is I have error handling in ALL my events and I have at least 100
events with code.
Please let me know if you have any ideas, thanks!
 
D

David C. Holley

There are products out there that you can download for free or purchase that
will allow you to setup code to be automatically inserted. The one that I
use to used I can't find any more, but google around.
 
C

ChrisO

G’day.

May I suggest you don’t, or at the very least make backups and be prepared
to re-test the application thoroughly.

Error handling, as apart from error reporting, is perhaps the most complex
subject in Access and perhaps in all programs.

In Access there seems to be an overriding predicate to preserve the
integrity of the data. This should mean that after an unexpected error occurs
it should be reported but how should it be handled? Given the nature of an
unexpected error, and after reporting it, how should it be handled? My gut
reaction would be to shutdown Access before damage to the data is caused.

Given that data preservation predicate then report the error and shutdown.
If an error occurs in the reporting of the error then shutdown without
reporting the error.

Most errors are predictable and therefore should be preventable.
Some errors can be induced deliberately for handling and not reporting.
(Within limits, Form errors on update of unique composite keys in high-speed
multi-user systems.)
Some errors can be handled with On Error Resume Next and then look at the
Err.Number for handling.
Some Functions may pass back to the caller the Err.Number as their returned
name value.
Some procedures may pass back to the caller (globally) the Err.Number.

I would suggest making the changes manually (one at a time after testing)
and not use another product to do it quickly or globally.

Regards,
Chris.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top