Hi Dixie,
If you can live with running these action queries from a form, rather than
executing them from the database window directly...
I'd suggest using the .Execute Method as below. There are no confirmation
messages nor any risk of leaving "SetWarnings = False" using this method.
----------------------------------------------------------------------------
----------
There are at least a couple of ways to implement this ... (Modifying
Reggie's code here)
1.) Run a saved action query
-----------------------------
********************************************
Private Sub cmdMyButton_Click()
Dim MyDB As DAO.Database
Set MyDB = CurrentDb
MyDB.Execute "qryMyActionQuery", dbFailOnError
Set MyDB = Nothing
End Sub
********************************************
OR
2.) Build an SQL string in the code directly, and avoid having to even
*have* a saved query.
This is my personal preference, as there is no chance that someone will
accidentally run this query without understanding the consequences.
-- Of course you'll have to modify the "MySQL" string below to match the SQL
from your present query --
(Open your saved query in SQL view, then copy and paste it into the code
window for modifications.)
-----------------------------------------------------------
********************************************
Private Sub cmdMyButton_Click()
Dim MyDB As DAO.Database
Set MyDB = CurrentDb
Dim MySQL as String
MySQL = ""
MySQL = MySQL & "UPDATE tblPartsInventory SET "
MySQL = MySQL & "tblPartsInventory.Selected = False "
MySQL = MySQL & "WHERE (((tblPartsInventory.Selected)=True));"
MyDB.Execute MySQL, dbFailOnError
Set MyDB = Nothing
End Sub
********************************************
--
HTH,
Don
=============================
Use
My*****@Telus.Net for e-mail
Disclaimer:
Professional PartsPerson
Amateur Database Programmer {:o)
I'm an Access97 user, so all posted code
samples are also Access97- based
unless otherwise noted.
Do Until SinksIn = True
File/Save, <slam fingers in desk drawer>
Loop
================================
"dixie" <di****@dogmail.com> wrote in message
news:uJ****************@nnrp1.ozemail.com.au...
I know I can do this Reggie, but I was looking for a way to turn off the
Action Query Confirmation only at the start of my program opening, as I
don't want it activated at any time. I do however wish to confirm Record
Changes and Document deletions.
The program runs on a remote site and they have their Confirm Action
Queries True by default. I just thought that if I could get it turned off in
code, it would circumvent the problem of having to turn warnings on and off
every time an action query runs.
dixie
< previous posts snipped> DL