I have the following references set: VBA, MS Access 10.0, OLE Automation & MS DAO 3.6 Object Library. Yet when I complie I get the error message, Method or Data Member not found. Any ideas?
Set rsXN3 = CurrentDb.OpenRecordset("xn3", dbOpenTable)
Set rsNiiN = CurrentDb.OpenRecordset("NSN", dbOpenTable)
rsNiiN.Index = "NSN_Index"
Do While Not rsXN3.EOF
strPartNumber = rsXN3.Fields("NSN"
If strPartNumber <> "" Then
rsNiiN.Seek "=", strPartNumber
If rsNiiN.NoMatch Then
***THE ABOVE LINE ERRORS OUT***
rsNiiN.AddNew
rsNiiN.Fields("NSN" = strPartNumber
rsNiiN.Update
End If
End If
I can't see anything wrong with what you have. Unless there may be some reason that the Db thinks that rsNiiN is an ADO type of recordset, which doesn't have the NoMatch method. I tried your code in a sample Db and had no problem until I changed the recordset declaration to ADODB.Recordset. If you have a reference to ADO in your Db and that reference is higher on the reference lists than the DAO reference, then any unspecified declaration will be assumed to be ADO. The best solution is to go to the declaration and specify ADAO.Recordset.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.