D
DC Hendrickson
I am an intermediate level VBA programmer using
WindowsXPPro and ACCESS2002. After six weeks I am getting
back to the programming project - so a little rusty.
I am trying to manipulate data in a form by use of the
recordsetclone. But I cannot get past simply assigning
the recordsetclone to a variable inside the procedure.
The scenario is thus:
The cursor enters a control in a subform which causes a
pop up form to open. A selection is made from the data in
the pop up form and a command button on the pop up form
is clicked to update the subform with that chosen data.
The code is located in the form module of a pop up form,
the ADODB and ADOX references are set.
The on_click event is as follows:
Private Sub cmdOK_Click()
Dim rst As ADODB.Recordset
Dim frm As Form
Set frm = Forms!mainform!subform!subsubform.Form
Set rst = frm.RecordsetClone
End Sub
The code causes the "Type Mismatch (error 13)" error upon
execution of the "set rst ..." line. Via the watch window
and a debug.print frm.name entry, the variable frm
appears to be set correctly.
Also, if I change the declaration of the rst variable to
OBJECT, I do not get the error. But if I do this, then
later on in the code an "rst.find" line causes an error
and tells me that this method is not available.
Any insite would be greatly appreciated.
Thanks, Daen
WindowsXPPro and ACCESS2002. After six weeks I am getting
back to the programming project - so a little rusty.
I am trying to manipulate data in a form by use of the
recordsetclone. But I cannot get past simply assigning
the recordsetclone to a variable inside the procedure.
The scenario is thus:
The cursor enters a control in a subform which causes a
pop up form to open. A selection is made from the data in
the pop up form and a command button on the pop up form
is clicked to update the subform with that chosen data.
The code is located in the form module of a pop up form,
the ADODB and ADOX references are set.
The on_click event is as follows:
Private Sub cmdOK_Click()
Dim rst As ADODB.Recordset
Dim frm As Form
Set frm = Forms!mainform!subform!subsubform.Form
Set rst = frm.RecordsetClone
End Sub
The code causes the "Type Mismatch (error 13)" error upon
execution of the "set rst ..." line. Via the watch window
and a debug.print frm.name entry, the variable frm
appears to be set correctly.
Also, if I change the declaration of the rst variable to
OBJECT, I do not get the error. But if I do this, then
later on in the code an "rst.find" line causes an error
and tells me that this method is not available.
Any insite would be greatly appreciated.
Thanks, Daen