(Q) How can I get rid of the default "You're about to change x
records....." confirmation message when I run an action query?
(A) There are two methods of doing this.
First one:
Toggle SetWarnings property before and after running the SQL statement.
Docmd.Setwarnings False
Docmd.runSQL "Delete * From tblCustomers"
Docmd.Setwarnings True
or
Second option:
Use the Execute method in which case SetWarnings is not required.
Dim db As Database
Set db = CurrentDb
db.Execute "Delete * from tblCustomers"
|