I have an Access 2000 form that has been filtered using the Filter By Form. I am now trying to create a clone of the resulting recordset so I can iterate through and find out the Primary Key values (without repositioning my form). When I try to set my ADODB.Recordset to the Me.Recordset.Clone method output I get a Type Mismatch error. I should not be returning DAO recordsets, as the library is not loaded - we are working in ADO only.
Code:
Dim R As ADODB.Recordset
Criteria = "orgID IN ("
Set R = Me.Recordset.Clone 'Error occurs here
While Not R.EOF
Criteria = Criteria & R("orgID").Value & ", "
R.MoveNext
Wend
Set R = Nothing
Criteria = Left$(Criteria, Len(Criteria) - 2) & ")"