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

Type Mismatch with Recordset

Status
Not open for further replies.

mikeyb540

Programmer
Jul 7, 2003
173
US
Hi, I get a Runtime error '13' Type Mismatch. error

My code is:
Dim rs As Recordset
Dim SQL As String
SQL = "SELECT count(table1.test) as TestCount FROM table1"
Set rs = CurrentDb().OpenRecordset(SQL)
Me.txtTest = rs("TestCount")
rs.Close


Tried the ADODB for Dim rs As ADODB.Recordset and still the same error.

Any thoughts?

Txs in advance
Mike
 
Found the solution. FYI to those who might have Type Mismatch errors.

It appears that by default MS-access 9 or higher default to ADO. If you change it to DAO the problem is solved.

To change to DAO go to Module edit:
TOOLS\PREFRENCES then uncheck ActiveX Data Object and check the Microsoft DAO.

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top