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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Toggle action query confirmation in MS Access 97

Status
Not open for further replies.

hughesjr

IS-IT--Management
Apr 16, 2001
2
US
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
 
Rick,

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.

Everything is working great
smiletiniest.gif
.

Johnny Hughes
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top