David C. Holley said:
I would suggest that its not really neccessary to DETEct the
SetWarnings. Just use the DoCmd.SetWarnings command wherever you want to
ensure that Warnings are ON or OFF. I doesn't do any harm to execute the
command twice as in
DoCmd.SetWarnings False
DoCmd.SetWarnigns False
The issue is more related to "leaving no footprints" when writing a new
routine. Imagine I have a routine which as its standard behaviour turns
warnings off at the beginning and on again at the end. If someone calls
that routine warnings will *always* be set to OFF when it returns. So my
routine has not left the system in the same states as before it was called,
and this may result in unexpected warnings happening in the routine which
called mine.
What would be nice is to take a local copy of the current warnings state at
my routine beginning, and then reinstate that at its end. This way my
routine "leaves no footprints". As it stands we are having to always reset
the warnings to what our local routines want them to be immeditely after we
call any other routine just in case that called routine did some SetWarnings
and hence may have left it in a different state. Its a pain.
Regards
AC