Turn off confirmations for action queries

G

Guest

I have an Access database that I distribute to multiple users. The forms contain modules that include action queries. Instead of instructing the individuals to "globally" turn off confirmations in Tools | Options (as this will affect all their Access applicatons) I would like to program Access to turn off these confirmations just for this database application

Anyone know how to do this?
 
F

fredg

I have an Access database that I distribute to multiple users. The forms contain modules that include action queries. Instead of instructing the individuals to "globally" turn off confirmations in Tools | Options (as this will affect all their Access applicatons) I would like to program Access to turn off these confirmations just for this database application.

Anyone know how to do this?

Since you are using code to run the queries, use:

DoCmd.SetWarnings False
DoCmd.OpenQuery "Query Name"
DoCmd.SetWarnings True
 
A

Allen Browne

You could use:
Application.SetOption("Confirm Action Queries"), False

Turning SetWarnings off would also work.

A better idea might be to use DAO to Execute the queries instead of RunSQL.
The advantage is that you can ask to be notified if query does not complete
for some reason (e.g. someone is editing a record you tried to update or
delete). The disadvantage is that DAO cannot use the Expression service to
resolve something like Forms!MyForm!MyTextbox *inside* the SQL string, so
you have to use:
strSQL = "... WHERE MyField = " & Forms!MyForm!MyTextbox & ";"

To execute the string:
dbEngine(0)(0).Execute strSQL, dbFailOnError

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Rob LMS said:
I have an Access database that I distribute to multiple users. The forms
contain modules that include action queries. Instead of instructing the
individuals to "globally" turn off confirmations in Tools | Options (as this
will affect all their Access applicatons) I would like to program Access to
turn off these confirmations just for this database application.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top