Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / September 2007

Tip: Looking for answers? Try searching our database.

Best way to update recordset

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gina K - 17 Sep 2007 15:30 GMT
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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.