Set ADO recordset equal to subform recordset

Rob601

New member
Local time
Yesterday, 23:32
Joined
Jan 26, 2004
Messages
5
I'm trying to create a recordset equal to a subform's recordset using ADO. I can do it with DAO:

Dim rs As DAO.Recordset
Set rs = theSubform.Form.Recordset

but this won't work with an ADO recordset. I can open an ADO recordset using the subform recordsource in the Open method:

Dim rs As New ADODB.Recordset
rs.Open theSubform.Form.RecordSource, CurrentProject.Connection

but this is no good because the subform is linked to the master form and that field is not in the subform's recordsource so rst is not set correctly.

Is there any way to just set rs equal to the subform's recordset?

Thanks!
 
Last edited:
Thanks for the help, but the problem is I didn't want to have to set the reference to the DAO library, because all the other recordsets I'm using in the code are ADO and I want to keep everything consistent if I can.

I didn't know Access uses DAO recordsets for forms - that's kind of a pain. I guess that means I'm looking for a way to set an ADO recordset from a DAO recordset.

Any other thoughts? I'm at a loss. Thanks!
 

Users who are viewing this thread

Back
Top Bottom