From: Chegu Tom on 2 Mar 2010 15:59 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
From: Stuart McCall on 2 Mar 2010 18:33 "Chegu Tom" <noemail(a)yahoo.com> wrote in message news:%2339ucxkuKHA.4940(a)TK2MSFTNGP05.phx.gbl... >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)
|
Pages: 1 Prev: Recognising the user switch between Form view and Data sheet v Next: REquery Subform |