Set Warnings on/off in VBA

G

Guest

by pressing one button am running 3 update queries that would update 3
different fields in 3 different tables at once and would not like to the
warning that you about to update 3 records three times, however I would like
the user to be informed that the following [Fields] in the following [tables]
with [countRecords] were updated.
I have set the warnings as DoCmd.SetWarnings False.

E.g, Should be like
Fields Table Records (This line is just an illustration can be
ignored)

FinalAns tblNo1 5
FinalAns tblNo2 5
FinalAns tblNo3 5
 
G

George Nicholson

Take a look at the RecordsAffected property in DAO help. If you use the
Execute method to run your updates, this property will tell you how many
records were just changed. So you can grab the value after each execute in
order to build one "combined" message when you're done.

Alternatively, before you run your updates you could run those queries as
SELECT queries, get the Recordset.Recordcount(s), run the Updates, and then
display a message with the various counts of modified records.

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