Update query warnings

A

acores

Hello.

I wonder how can I avoid (with VB), the warning messages that appear when I
execute update query’s.

I know that I can go to Tools > Options > (Tab) Edit/Find in Access 2003 and
just uncheck the three boxes in the Confirm section (Records changes,
Documents elimination, Action query’s), but then I need to do it on every
machine that will run the database. And that's what I don’t want.

Is possible to integrate in a VB module those procedures in order that the
user doesn’t realize at all that those boxes are being unchecked when he
executes the update query, and checked again, when the query ends?

I just don’t know the exact commands in VB that control those three boxes in
order to turn them to False/True.

Thank you for the effort.

Regards
 
A

Andy Hull

Hi

Use...

DoCmd.SetWarnings False

(& turn them back on with True)

Regards

Andrew Hull
 
S

SteveS

For action queries (like Update, Delete or Insert), I prefer to use the
Application.Execute method.

Example 1:

strSQL = "UPDATE Contacts SET Contacts.SndX = soundex([LastName]) WHERE
((Not (Contacts.LastName) Is Null));"

Currentdb.Execute strSQL, dbFailOnError


Example 2:

Set db = CurrentDb

db.Execute "UPDATE Contacts SET Contacts.SndX = Null;", dbFailOnError


You don't get the warnings, but you will still get error messages.

HTH
 
Top