Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to check whether system messages are to be displayed 2

Status
Not open for further replies.

Schof

Programmer
Nov 18, 2002
103
CA
The SetWarnings action/method is used to turn system messages on or off. Is there any way (other than the use of module/global level variables) to check the system messages status?

Background:

I want to call a precedure that needs to turn the messages off in order to execute some code and not display anything to the user. However, I only want to turn the messages back on if they were on when the procedure was first called (hence the questions above).
 
I think the only way you can do it, is to get and save its current value in a local variable. Then, prior to your procedure exiting, reset it (if need be).
 
But how do I "get and save its current value"?
 
See "SetOptions" via on-line help (also GetOptions). For example, to turn delete warning message off, do something like this:

Dim bolOrigValue as Boolean

bolOrigValue = Application.GetOptions("Confirm Document Deletions")

if (bolOrigValue) then application.SetOptions "Confirm Document Deletions", False

....

if (bolOrigValue) then Application.SetOptions "Confirm Document Deletions", True
 
Thx for the introduction to that method. I'll put it to use elsewhere but it doesn't help me check the status of the system messages, namely whether SetWarnings are set to True or False.
 
What kind of warnings do want to disable? The setoptions should work. Via the database window, select Tools | Options and select the Edit/find tab. Then check out the Confirm section. Deselect them to see which one does what you want. If, by deselecting one of them, the warnings you want disabled are disabled, then you can use the SetOptions method to do it programmtically.
 
Action queries...I'll need to check whether it is worth while replacing what I have with that new method ('cause my app is rather large!). Thx for all your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top