Update query vs. loop through recordset

R

R Fourt

When updating a group of records (50 -100) is it preferable to use an update
query or create a recordset and loop through each records.

In my case, I'm updating two fields, a date and a logical. I've been using
an update query based on criteria pulled from variables at runtime. However,
it appears that some records are skipped from time to time.

Data integrity is the key issue here. The sub is run when a report_close
event fires. The user prints the report and then is prompted to update the
records.
 
A

Allen Browne

The update query should be easier to create and maintain, and marginally
more efficient, so would be my preference. Both approaches should be
reliable.

If you are experiencing issues with the Update query approach, don't turn
SetWarnings off, but use Execute with dbFailOnError so you know if there is
any problem. Details in:
Action queries: suppressing dialogs, while knowing results
at:
http://allenbrowne.com/ser-60.html
 

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