I need to be able to turn off the warning for an SQL Update command. I want to do this for individual queries (or DoCmd.RunSQL statements)...but be able to leave the global setting for the MS Access application set to warn on updates.
I'm not sure whether what you want is to suppress the confirmation dialogs, or all system interaction with the user.
To suppress the confirmation dialogs, use the GetOption method to save the current value of the "Confirm Action Queries" option, then use SetOption to turn it off. When you're done with your RunSQL, restore the original option value with SetOption again.
To turn off all interactions, use DoCmd.SetWarnings False before the RunSQL, and DoCmd.SetWarnings True afterward. Rick Sprague
Thanks...I used the DoCmd.SetWarnings False and then DoCmd.SetWarnings True before and after the DoCmd.SQL statement, and everything works great.
I am using a sql statement to track form/report usage, so I want the update to happen in the background without confirmation ... but only for this transaction.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.