Automatically accepting YES in update query

G

Graham

I am running a query through a macro/VB Code. Each time the query runs the
system asks if I want to update and I click on YES.

How can I force a yes or how do I stop the system asking the question.

Thanks inadvance for any help.
Graham
 
O

Ofer

Use the set warnings to false

docmd.setwarnings false ' so it wont ask you
docmd.openquery "QueryName"
docmd.setwarnings true

But don't forget to set it back to true after you running the query
 
V

Van T. Dinh

You can also use the Execute Method which won't ask for confirmation.

Check Access VB Help for the Execure Method (of DAO or ADO)
 
Top