Recordset won't pass to Sub

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

Mark

I can't get a Recordset Object to pass to a sub. Gives
me a type mismatch error (13).

Call Output(rst)
:
:
Private Sub Output (rst As Recordset)

It would be great to pass the current record of the
recordset too but I get the same error.

rst.movenext
Call Output(rst.fields)
:
:
Private Sub Output (rstFields As Fields)

Thanks,
Mark
 
The type mismatch error indicates that you have a DAO recordset and the code
is expecting an ADO one, or the reverse.

To solve the problem, be explicit about what you are passing, e.g.:
Private Sub Output (rst As DAO.Recordset)

It may be a good idea to remove the reference to the libary you don't use,
as you generally need only one or the other.

More info on references:
http://allenbrowne.com/ser-38.html
 
I notice that you have not pre-qualified the Recordset. It
is important that you do so if you are refrencing both the
DAO and ADO object libraries as both these object models
have Recordset objects.

Hope This Helps
Gerald Stanley MCSD
 
Back
Top