Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Method or data member not found 3

Status
Not open for further replies.

Domino2

Technical User
Jun 8, 2008
475
GB
I am getting an error "Method or data member not found" with the code highlighting on [List2]. List2 exists, ID1 is the bound column value?

I cannot see anything missing in references, the same code works in another db. Any ideas, thanks

Private Sub List2_Click()
Dim RS As Recordset


Set RS = Me.RecordsetClone
RS.FindFirst "[ID1] = " & Me![List2]
Me.Bookmark = RS.Bookmark
 
Are the references in the same order between the databases? The code looks like it should work for DAO but I'd have to lookup ADO.

Explicitly...

Code:
Private Sub List2_Click()
    Dim RS As DAO.Recordset

    Set RS = Me.RecordsetClone
    RS.FindFirst "[ID1] = " & Me![List2]
    Me.Bookmark = RS.Bookmark
End Sub
 
Thanks Remou, that worked. Wonder why it passes through okay in another db. I will change that as well in case it fails. Thanks again
 
The other database probably has Microsoft DAO 3.x Object library higher up the references list. It is safer to specify the library.
 
The database is a copy (windows explorer copy) of the working database. Both have references DAO 3.6 Object Library, positions in reference lists are identicle.
 
The issue would be if Microsoft ActiveX data objects 2.5 library is listed before the DAO reference... Note your version may be different.
 
DAO is fourth down the list, following ActiveX. Many thanks
 
If you don't play with ADO then simply remove the reference ...
 
Thanks PHV but I don't have ADO referenced.
 
Microsoft ActiveX data objects 2.5 library is the ADO reference. If you declared for ADO like we had you do for the DAO.Recordset it would be ADODB.Recordset. The problem is both libraries have the recordset object. It types the one found first in the list unless you explicitly declare it.
 
I see, appologies to PHV. I did not know that biy so thanks. I use the ActiveX as there are calendar controls used. So if I make DAO top reference then should that be okay, regards
 
It is still better to get into the habit of typing DAO.Recordset.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top