Forum Discussion
michael99chronister
Jul 17, 2022Copper Contributor
Loop in an access macro
Can I do looping within an access macro?
michael99chronister
Jul 19, 2022Copper Contributor
arnel_gp I probably could for most things I have tried. I am still getting up to speed on Access programming with macros. My question is, if I want to change some fields in a lot of records, doesn't a query just return records found, or it can append records or delete records. But how do I get it to update a few fields in all the records selected?
arnel_gp
Jul 19, 2022Steel Contributor
you can use an Update Query with Criteria of your selected records.
- George_HepworthJul 20, 2022Silver ContributorIn most cases, an update query would probably be more efficient and faster, as well as less complicated to create. Check out the acronym "RBAR", which stands for "Row by Agonizing Row"
However, there are some scenarios where a looped recordset are required. It's the fussy details that make possible the proper selection of a technique.