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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set dbs = CurrentDb

Status
Not open for further replies.

AGGGG

Programmer
Joined
Oct 8, 2003
Messages
20
Location
GB
When I run the code below I get the error message:
Run time error 13, Type Mismatch
After I select the 'debug' option the following line is highlited: Set dbs = CurrentDb
I am using Access 2002.

Help would be appreciated.

Dim dbs As DAO.Database
Dim MyRecSet As DAO.Recordset
Dim SQLString As String

Set dbs = CurrentDb

SQLString = ("SELECT * FROM tblPartNumber")

Set MyRecSet = dbs.OpenRecordset(SQLString)
 
Nothing obvious here to me.
You do have a reference set to DAO3.6?
Does Debug>compile produce any error?
 
have you set a reference for microsoft DAO 3.6 object library

Hope this helps
Hymn
 
The code runs on 2 other pc's running Access 2002,

What I did notice was the other pc's had 'Microsoft Access 9.0 Object Library' enabled, while the pc that produced the error had 'Microsoft Access 10.0 Object Library' enabled
 
Access10 = Access2002;

What about the DAO3.6 reference?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top