Best way to update recordset

G

Guest

I'm working with an employee training application. I have a "class session"
form with class date, class instructor, class location, etc. On that form is
a subform showing all employees enrolled in that particular class session. I
want to click a button on the main form and update the value in the "class
completed" control for all the records on the subform to "true". What's the
best way to approach this - do I loop through the recordset, use an append
query, or something else altogether?

Thanks.
 
A

Al Campagna

Gina,
Assuming your subform records are associated to the main form via some
unique field... like ClassID,
have the button call an Update query that updates all the records in the
subform table to true, that have a ClassID equal to the ClassID value on
your form.
In your Update query, use this criteria against the ClassID field...
=Forms!frmYourMainClassForm!ClassID
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html
"Find a job that you love... and you'll never work a day in your life."
 
D

Douglas J. Steele

It's almost always more efficient to use a query than to loop through a
recordset.
 

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