Update query warnings

G

Guest

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
 
G

Guest

Hi

Use...

DoCmd.SetWarnings False

(& turn them back on with True)

Regards

Andrew Hull
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top