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 IamaSherpa 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
Oct 8, 2003
20
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top