Type mismatch error

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

Why oh why do I get a Run-time Error '13' - type mismatch
error in the following code (Code is under the click
property of a button on a form):

Private Sub ProcessTransaction_Click()
On Error GoTo Err_ProcessTransaction_Click
Dim db As Database
Dim Members As Recordset
Dim Transactions As Recordset
Dim LastBalance As Recordset

Set db = CurrentDb
Set Members = db.OpenRecordset("Select_Members")
<<Error occurs here
'Select_Members is a select query

Any help is greatly appreciated. Thank you in advance.

..
 
Mark said:
Why oh why do I get a Run-time Error '13' - type mismatch
error in the following code (Code is under the click
property of a button on a form):

Private Sub ProcessTransaction_Click()
On Error GoTo Err_ProcessTransaction_Click
Dim db As Database
Dim Members As Recordset
Dim Transactions As Recordset
Dim LastBalance As Recordset

Set db = CurrentDb
Set Members = db.OpenRecordset("Select_Members")
<<Error occurs here
'Select_Members is a select query


This looks like a references issue. You probably have both
DAO and ADO libraries checked and they have some object name
in common, e.g. Recordset. If you did not intend to use ADO
then you should uncheck it to remove the ambiguity.

If you do intend to use both libraries (or even if not), you
can disambiguate the declarations by prefixing the objects
with the library name:

Dim db As DAO.Database
Dim Members As DAO.Recordset

or for ADO
Dim rs As ADODB.Recordset
 
Back
Top