Reputation: 3680
I'm building a front end for an Access database. My users don't want or need to see the "You about to insert X records" sort of messages that come up when you run an INSERT, UPDATE or DELETE query.
The only way I've been able to find to turn these messages off programtically is DoCmd.SetWarnings False
in VBA and then turning them on afterwards. However, this disables all warnings, and if the code errors before the DoCmd.SetWarnings True
command, then they stay off, which can be anything from a nuisance to dangerous.
Is there any way of supressing only the SQL warnings in Access and leaving others (e.g. the "do you want to save this query" messages) intact?
Upvotes: 2
Views: 3375
Reputation: 3020
There is also this alternative, for those not wanting to write code
In Access Options > Advanced > Uncheck the required confirmation for the desired fields.
Upvotes: 2
Reputation: 97131
Run "action queries" with Database.Execute
or QueryDef.Execute
instead of DoCmd.RunSQL
.
The .Execute
methods do not trigger those confirmation messages, so no motivation to use SetWarnings False
to suppress them.
Upvotes: 5