RecordsetClone Property Error (1 Viewer)

John Baker

Registered User.
Local time
Today, 16:44
Joined
Apr 13, 2005
Messages
35
Having difficulty with executing the Recordsetclone property of my form.

Recordsource for 'frm_event' is based on a table, tbl_events.

On the Form's 'OnCurrent' event, I make a call to the function 'DisableEnable([Form])':

Public Function DisableEnable(frm As Form)
Dim rstClone As Recordset
Set rstClone = frm.RecordsetClone

Getting a 'Type mismatch' error when I try to create the RecordsetClone.

This is my first attempt at working with the RecordsetClone property.

Any help or guidance would be appreciated!

John
 

RuralGuy

AWF VIP
Local time
Today, 14:44
Joined
Jul 2, 2005
Messages
13,826
Do you have a refererence set for DAO? RecordSetClone is DAO. <ALT> F11 Tools>References.
 

John Baker

Registered User.
Local time
Today, 16:44
Joined
Apr 13, 2005
Messages
35
Yes, I have a reference set to the Microsoft DAO 3.6 Object Library.
 

RuralGuy

AWF VIP
Local time
Today, 14:44
Joined
Jul 2, 2005
Messages
13,826
The RecordSetClone is always available so you don't really need to set a reference to it except under certain conditions. You should really disambiguate the references like:
Dim rstClone As DAO.Recordset

then you would set the object with:
Set rstClone = Me.RecordsetClone
 

mattP

Registered User.
Local time
Today, 21:44
Joined
Jun 21, 2004
Messages
87
All,

I am having a similar problem, I have my code set up exactly as you have advised in this thread but I still get a Run-time Error 13, Type mismatch error?

I have the DAO referenced as well.

Any idea's ?

Many thanks

MattP
 

RuralGuy

AWF VIP
Local time
Today, 14:44
Joined
Jul 2, 2005
Messages
13,826
Please post the code you are using and show the line that is raising the error.
 

mattP

Registered User.
Local time
Today, 21:44
Joined
Jun 21, 2004
Messages
87
RuralGuy,

I started from scratch and got the code working in the ned, thanks for your response anyway.

MattP
 

Users who are viewing this thread

Top Bottom