Recordset won't pass to Sub

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
 
A

Allen Browne

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
 
G

Gerald Stanley

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top