Find record

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
 
P

Pieter Wijnen

you can't use an adodb recordset with a DAO database...
Change ADODB.recordset to DAO.Recordset might help ....

Pieter
 

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

Similar Threads

Reaches Maximum size (2GB) when calculating procedure 2
consistent error on first record 11
run time error 6 overflow 5
overflow error 6 7
Sort Question 15
Create new table sorted 2
Edit Recordset 2
Excel/SQL Problem 3

Top