RecordsetClone issue

R

Robert

I am using a Public Function to Enable or Disable command
buttons depending on the situation. However, I am getting
the same error message when the form loads as I am when
using the Click property of the command buttons. The
procedure at the top is the following. And, when it is
debugged, it points to the line: Set rstClone =
frm.RecordsetClone.

Public Function DisableEnable(frm As Form)
Dim rstClone As ADODB.Recordset
'Create a clone of the form's recordset to
'move around in without affecting the form's
'recordset
Set rstClone = frm.RecordsetClone

I appreciate your help and thank you in advance.
 
T

Tim Ferguson

Dim rstClone As ADODB.Recordset
'Create a clone of the form's recordset to
'move around in without affecting the form's
'recordset
Set rstClone = frm.RecordsetClone

Isn't RecordsetClone a DAO method?

Tim F
 
D

Dirk Goldgar

Tim Ferguson said:
Isn't RecordsetClone a DAO method?

If you're in an MDB file, RecordsetClone will return a DAO recordset;
if you're in an ADP, it will return an ADO recordset. Odds are,
Robert's error message is telling him he's in an MDB, and he needs to
set a reference to DAO and delare rstClone as a 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