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!

Turn off Action Query Confirmation Message

Status
Not open for further replies.

Larft

Technical User
Dec 9, 2002
55
I have unchecked the setting in "Tools, Options, Confirm, Action Queries" to try to disable the confirmation box that comes up when I run the "MakeTable" queries that are built into my Access '97 database but I still get the confirmation message and subsequently have to answer yes to all of them. Is there a code switch to turn this off? I'm not adept at VB coding so a working example would be greatly appreciated.
 
Docmd.SetWarnings False 'Before each set of queries

Run queries.............

Docmd.SetWarnings True 'After each set of queries
 
Hi,

in the code to turn that off:
DoCmd.SetWarnings False

to turn it back on:
DoCmd.SetWarnings True Mal'chik [bigglasses]
 
Larft

One Warning - make sure that your code has an error handling procedure in it, and that this error handling sets the Warnings back on. Otherwise, if your code produces an error and aborts before finishing, your Warnings will not be set back on, and you will get no access messages at all.

If you have used the toolbox wizard to create code (most likely a command button procedure) you can view that code to see an example of basic error handling. This is reasonably easy to add to your code modules when you create them manually, and can save a lot of time when developing new routines that don't work first time around.

Add the line Docmd.SetWarnings True to your error handler to ensure that the warnings are turned back on however the code exits.

HTH
Lightning
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top