On Tue, 11 Mar 2008 21:10:26 -0400, MLH <CRCI@NorthState.netwrote:
Simple: in a standard module create this:
private m_blnWarningState as Boolean
public sub SetWarningsOff()
docmd.SetWarnings False
m_blnWarningState = False
end sub
public sub SetWarningsOn()
docmd.SetWarnings True
m_blnWarningState = True
end sub
public function GetWarningState() as Boolean
GetWarningState = m_blnWarningState
end function
-Tom.
Quote:
>Access 97 does not provide a means of reading the
>most recent setting for SetWarnings Method. For
>example, if you had CBF that called a procedure in
>a global module and the following statement was
>executed:
>
>DoCmd.SetWarnings False
>
>Then you would not be able to take peek at the
>setting when processing returned to the calling
>procedure. You'd simply have to run the Method
>there again to make sure the setting is what you
>want it to be from that point forward.
>
>I'm not saying there's anything wrong with that.
>One can simply adapt. What is unhandy about not
>being able to read the setting? Well, if you are
>deliberately trying to identify and correct instances
>where the setting is not what you intended for it to
>be after calling some saved procedure.
>
>I'd like to have a procedure that did something
>trivial - something with no adverse effect that
>when called, would do something that could
>determine the setting - indirectly perhaps. Then
>I could sprinkle my code with calls to this procedure
>as liberally as I wanted. At some point I would be
>satisfied, I'm sure, that SetWarnings settings made
>in called procedures did not leave things in an
>unexpected state upon return to the calling
>procedure.