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

type mismatch error 3

Status
Not open for further replies.

atadbitslow

Programmer
Feb 26, 2001
301
0
0
US
Ques: I get a type mismatch error after the openrecordset command.....why?

Private Sub addnewrecord() '(byval rst as Recordset, strinput as String)
Dim db As Database
Dim rs As Recordset
Dim strinput As String
Dim strmsg As String
Dim varx As Variant
Dim mymsg As String
Dim dq As String
Set db = CurrentDb

Set rs = db.OpenRecordset("variables")
****

You may need more information....?
Variables is a table with an autonumber and 2 text fields.

Thanks!
 
Guessing you're using this in a Access 2000+ version, then you need the following:

* ensure the Microsoft 3.# Object Library is checked (in any module Tools | References)
* explicitly declare the DAO variables:

[tt]Dim db As DAO.Database
Dim rs As DAO.Recordset[/tt]

Roy-Vidar
 
Thanks so much for this, it was driving me crazy. I was getting the same error even though my code worked in other access projects.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top