syntax on ADODB recordset

S

smk23

In the following code, I get an error "type mismatch" on the last line where
I am trying to establish a new recordset. What do I need to change?

Public Function fblnRecordNav2(frmActive As Form, _
intDirection As Integer) As Boolean

On Error GoTo Err_Unexpected

Dim rstClone As ADODB.Recordset

Set rstClone = frmActive.RecordsetClone


Thanks,
Sam
 
D

Dirk Goldgar

smk23 said:
In the following code, I get an error "type mismatch" on the last line
where
I am trying to establish a new recordset. What do I need to change?

Public Function fblnRecordNav2(frmActive As Form, _
intDirection As Integer) As Boolean

On Error GoTo Err_Unexpected

Dim rstClone As ADODB.Recordset

Set rstClone = frmActive.RecordsetClone


Do you know that the recordset of frmActive is an ADODB recordset? If the
form is in an MDB file, not an ADP, and you didn't explicitly set the form's
Recordset property to an ADODB recordset you created, then the form's
Recordset and its RecordsetClone will both be DAO recordsets, not ADODB
recordsets.

If you're dealing with a DAO recordset, then declare rstClone as such:

Dim rstClone As DAO.Recordset
 

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