cravincreeks
Technical User
Hello all.
I developed a simple MS Access 2002 database (.mdb) with a few forms that have custom code. I initially used ADO 2.7 libraries. I sent it to a person in an entirely different department who is using Access 2000. She's repeatedly getting "Method or data member not found" when she attempts to use one of these forms with custom VBA code.
I made sure that she had all of the correct references set and she did. Then I rewrote all of the code that she will be using, which is really just subset of the entire project, using DAO. I explicitly declared all DAO variables as such (eg, Dim rsParks as DAO.Recordset). I also commented out any procedure that she didn't need that contained some ADO code - including variable declarations. Currently, there are no references to ADO in her copy of the entire database project. I also had her move the DAO reference up above the ADO reference.
Here is the code
This code functions perfectly on my computer, but does not on hers. It's bombing on lstResults.AddItem (rsPark!NAME_LONG) that is inside the recordset loop - that row is highlighted when she types text into a text box and triggers the code.
She's using Access 2000 on Windows 2000 and I'm using Access 2002 on Windows 2000. Somebody in her office opened the database using Access 2002, converted it to Access 2000 and sent it to her. The code still didn't work.
I'm at a loss. Please help!
I developed a simple MS Access 2002 database (.mdb) with a few forms that have custom code. I initially used ADO 2.7 libraries. I sent it to a person in an entirely different department who is using Access 2000. She's repeatedly getting "Method or data member not found" when she attempts to use one of these forms with custom VBA code.
I made sure that she had all of the correct references set and she did. Then I rewrote all of the code that she will be using, which is really just subset of the entire project, using DAO. I explicitly declared all DAO variables as such (eg, Dim rsParks as DAO.Recordset). I also commented out any procedure that she didn't need that contained some ADO code - including variable declarations. Currently, there are no references to ADO in her copy of the entire database project. I also had her move the DAO reference up above the ADO reference.
Here is the code
Code:
Dim rsPark As DAO.Recordset, db As DAO.Database
Set db = CurrentDb
Call ClearList(lstResults) 'custom function
txtSearch.SetFocus
sSQL = "SELECT tParks.NAME_LONG FROM tParks WHERE tParks.NAME_LONG Like '*" & txtSearch.Text & "*';"
Set rsPark = db.OpenRecordset(sSQL, dbOpenSnapshot, dbReadOnly)
Debug.Print sSQL
If rsPark.RecordCount = 0 Then Exit Sub
rsPark.MoveFirst
Do Until rsPark.EOF
lstResults.AddItem (rsPark!NAME_LONG)
rsPark.MoveNext
Loop
She's using Access 2000 on Windows 2000 and I'm using Access 2002 on Windows 2000. Somebody in her office opened the database using Access 2002, converted it to Access 2000 and sent it to her. The code still didn't work.
I'm at a loss. Please help!