recordset clone

C

Chegu Tom

I have a main form with a linked subform (combo boxes in the main form
determine the records in the subform)

I have a button on the main form. When that button is clicked, I want to
loop through the records in the subform.

I believe this needs a recorset clone from the subform. How do I reference
that from the main form? I thinki I know how to do the looping once I get
the recordset available

Thanks
 
S

Stuart McCall

Chegu Tom said:
I have a main form with a linked subform (combo boxes in the main form
determine the records in the subform)

I have a button on the main form. When that button is clicked, I want to
loop through the records in the subform.

I believe this needs a recorset clone from the subform. How do I
reference that from the main form? I thinki I know how to do the looping
once I get the recordset available

Thanks

Dim rs As DAO.Recordset

Set rs = Me.SubformControlName.Form.RecordsetClone

Do Until rs.EOF
'Process the data
rs.MoveNext
Loop

Set rs = Nothing

(substitute SubformControlName with the actual name of your subform control)
 

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