Find record

  • Thread starter Thread starter hlam
  • Start date Start date
H

hlam

Can someone point out what's wrong with my code that returns "run time error
438 - object doesn't support this property or method"

Dim rst1 As New ADODB.Recordset
Dim rst2 As New ADODB.Recordset
Dim db As DAO.Database

Set db = CurrentDb

Set rst1 = db.OpenRecordset("tblGetBrInfo")
Set rst2 = db.OpenRecordset("SELECT * FROM tblMachine_Info ORDER BY
ABMNo", dbOpenDynaset)
rst1.MoveFirst
rst2.MoveFirst

rst2.Find rst2.[ABMNo] & " = '" & rst1.ABMNo & "'" '
error message at this line

If rst2.NoMatch Then
MsgBox "no match"
Else
MsgBox "match"
End If
 
you can't use an adodb recordset with a DAO database...
Change ADODB.recordset to DAO.Recordset might help ....

Pieter
 
Back
Top