“RunTime-13” Type mismatch error in code after access 2003 convert to 2010.

Dim vdb As Database
Dim mtab As Recordset
Dim vproj As String, vspec As String, VType As String
Dim mcount As Integer, mcount1 As Integer
Dim mdate As Date
Set vdb = CurrentDb()
vproj = Me![Combo0]
vspec = Me![Combo2]
VType = Me![Combo7]
mcount = 0
mcount1 = 0
Set mtab = vdb.OpenRecordset("select * from Master where projcode='" + vproj + "' and specno ='" + vspec + "' and jtype='" + VType + "'")
“(Showing mtab= Nothing”)

You receive a "Type mismatch" error when you run the OpenRecordset method
 Email
 Print
Symptoms
If you dimension an object as a Recordset and then set that object to databaseobject.OpenRecordset(source), you may receive the following error message:
Run time error '13': Type mismatch
Cause
If your project contains references to both the Data Access Objects (DAO) library and the ActiveX Data Objects (ADO) library, you may see multiple Recordset entries in the list when you dimension the Recordset object. This error occurs when you list the ADO library with a higher priority than the DAO library in the References dialog box, regardless of which Recordset entry you select from the list.
Resolution
ANADMANNI

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.