Custom Error Messages

  • Thread starter Eternally Frustrated
  • Start date
E

Eternally Frustrated

Hi,

I was wondering if there is a way of making global custom error messages for
my entire database rather than having to go into each form, each button, etc
and defining them. I didn't know if this could be done through modules,
macros, etc (probably because I don't know what they are). Right now, I have
lots of forms and buttons and if I want to override an Access error message
with my own, I have to go into each one of these and change what I have
previously coded.

Thanks for the help...
 
B

Brendan Reynolds

Eternally Frustrated said:
Hi,

I was wondering if there is a way of making global custom error messages
for
my entire database rather than having to go into each form, each button,
etc
and defining them. I didn't know if this could be done through modules,
macros, etc (probably because I don't know what they are). Right now, I
have
lots of forms and buttons and if I want to override an Access error
message
with my own, I have to go into each one of these and change what I have
previously coded.

Thanks for the help...


Not if I understand the question correctly, no. I mean you can define the
*text* of your custom message in a global constant, and use that constant
throughout your code. That way, if you want to change the message in the
future, you only have to change it in one place *after* you have edited each
of your event procedures to use that constant. But there's no way to avoid
the need to edit each event procedure the first time. If your existing error
handlers follow a standard pattern, you might possibly be able to save
yourself some work using find and replace. But there's no application-level
error event, if that's what you were hoping for.
 
M

Michael

How would I set up a global constant. I know I would dimension it as a string
and set it equal to to what I want it to say, but where would this be done so
that it is accessible by all of my events?
 
Top