MS ACCESS 2010 VBA loop through multiple recordsets and update a recordset with a value

Could you give me an example on how to set and loop through multiple recordset

Set  Recordset1 = Select Statement

Loop through Recordset1
    set Recordset2 = Select from table where column = Recordset1.column
    Loop through RecordSet2
       concatenate Recordset2.column into hold_variable
         hold_variable  =hold_variable+ "," +  RecordSet2.column
    End loop
    'How do I set up a recordset to update a value in a table?
    Update a column in table with hold_variable
 End loop
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rey Obrero (Capricorn1)Commented:
dim rs1 as dao.recordset, rs2 as dao.recordset
'open recordset1

set rs1=currentdb.openrecordset("select * from table1")

'loop recordset1

do until rs1.eof
          'open recordset 2
          set rs2=currentdb.openrecordset("select * from table2 where [column]=" & rs1![column])

          'loop recordset2
          do until rs2.eof

                  hold_variable  =hold_variable & "," &  rs2!column
          'update column in table
         currentdb.execute "update tableX set [columnX]='" & hold_variable & "'", dbfailonerror



Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.