warnings

  • Thread starter Thread starter Alec
  • Start date Start date
A

Alec

How do I code for the deletion or other warnings no to
appear at all? i.e. I run an update query and I do not
want the warnings or notices to appear at all, how do I do
it?
 
If using VBA code:
(1) Put this step in the code just before running the query:
DoCmd.SetWarnings False
Then put this step in the code right after running the query:
DoCmd.SetWarnings True

(2) Use the CurrentDb.Execute method to run the query:
CurrentDb.Execute "QueryNameOrSQLStatement", dbFailOnError

If using a macro:
(1) Put this action in the macro just before running the query:
SetWarnings (set it to No)
 
How do I code for the deletion or other warnings no to
appear at all? i.e. I run an update query and I do not
want the warnings or notices to appear at all, how do I do
it?

If you run the queries by code (from a command button click event, for
example) you can set the warnings on and off:
DoCmd.SetWarnings False
DoCmd.OpenQuery "DeleteQueryName"
DoCmd.SetWarnings True

You can also permanently turn them off at
Tools + Options + Edit/Find
Remove the check mark from Confirm Action queries check box.
This is not recommended, however.
 
Back
Top