D
Dawn Rhoads
I would like to make some custom message boxes in response to some particular
errors. One error is '4605' and one is '5894'. I believe there is a way to
look for a particular error code and then substitute your own custom message
box?
The background: We have several fill-in forms that use various macros. In
order for the macros to run correctly two things must be true 1) must be
unprotected (the start out locked for filling in form fields) This is the
one that generates the 4605 error 2) must be in "print" view (the macro
inserts things into the header and footer, so it needs to be able to "see"
those). This one generates the 5894 error.
These were recorded macros, so the code is certainly not the cleanest in the
world, and I'm definitely no programmer! I'm sure something could be added
to the macro to change the protected setting and the view setting, but I'm
not sure how to make sure it is returned to whatever settings the user
originally had. I wouldn't want to have the macro change the settings on
them without returning to the original values. I'm also nervous about
unintended consequences -- for instance, it used to be that when you unlocked
and re-locked a form, all the information was erased. That problem has been
corrected, but who knows what the future might bring! That's why it seemed
like the dialog box approach might be better. Most of our users actually
already have the correct settings when they run the macro, it's just a
handful who occasionally have to be reminded.
If anyone can advise me on either the message box approach, or some fancy
way to detect and change the settings as appropriate, I'd sure appreciate the
help. Thanks for your time!
errors. One error is '4605' and one is '5894'. I believe there is a way to
look for a particular error code and then substitute your own custom message
box?
The background: We have several fill-in forms that use various macros. In
order for the macros to run correctly two things must be true 1) must be
unprotected (the start out locked for filling in form fields) This is the
one that generates the 4605 error 2) must be in "print" view (the macro
inserts things into the header and footer, so it needs to be able to "see"
those). This one generates the 5894 error.
These were recorded macros, so the code is certainly not the cleanest in the
world, and I'm definitely no programmer! I'm sure something could be added
to the macro to change the protected setting and the view setting, but I'm
not sure how to make sure it is returned to whatever settings the user
originally had. I wouldn't want to have the macro change the settings on
them without returning to the original values. I'm also nervous about
unintended consequences -- for instance, it used to be that when you unlocked
and re-locked a form, all the information was erased. That problem has been
corrected, but who knows what the future might bring! That's why it seemed
like the dialog box approach might be better. Most of our users actually
already have the correct settings when they run the macro, it's just a
handful who occasionally have to be reminded.
If anyone can advise me on either the message box approach, or some fancy
way to detect and change the settings as appropriate, I'd sure appreciate the
help. Thanks for your time!