Solved

How update all records in a subform

Posted on 2014-03-12
2
417 Views
Last Modified: 2014-03-12
I have a main form that has a checkbox and the onclick event of the checkbox is:

    If Me.chkbxGrowDay1Selected = True Then
       Forms!frmPlanted!subfrmReady.Form!txtReadyDate = Me.txtplantdate + Me.txtGrowDaysCalc
    End If

But when the checkbox is clicked only the first record in the subform on the main form is updated.  I need all records in the subform to update.

How do I get that to happen?  It's almost like it has to loop through the records in the subform but I don't know how to make that happen.
0
Comment
Question by:SteveL13
2 Comments
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 500 total points
ID: 39923413
Either:

1. Execute an update query and then requery the form

or

2. Loop through the forms records:

 Dim rst as DAO.Recordset

Set rst = Me.RecordsetClone

If rst.Recordcount > 0 then
   rst.MoveFirst
   
   Do until rst.Eof
        ' do something
   Loop
End if

Set rst = nothing

Jim.
0
 

Author Comment

by:SteveL13
ID: 39923509
This worked:

 Execute an update query and then requery the form
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now