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.
Al Campagna - 17 Sep 2007 15:37 GMT
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

Signature
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."
> I'm working with an employee training application. I have a "class
> session"
[quoted text clipped - 9 lines]
>
> Thanks.
Douglas J. Steele - 17 Sep 2007 16:17 GMT
It's almost always more efficient to use a query than to loop through a
recordset.

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
> I'm working with an employee training application. I have a "class
> session"
[quoted text clipped - 9 lines]
>
> Thanks.