RecordsetClone issue

  • Thread starter Thread starter Robert
  • Start date Start date
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.
 
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
 
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.
 
Back
Top