KeithWilliams
Registered User.
- Local time
- Today, 07:05
- Joined
- Feb 9, 2004
- Messages
- 137
Hi,
I am trying to convert my application to ADO, and have a problem with assigning a recordset to the Recordset object of the form, in the Open event:
(I know, I know, I should have changed the object names from the original DAO variables!)
This code produces the message:
"Run-time error '7965':
The object you entered is not a valid Recordset property."
The original code worked OK, where rst is a DAO recordset and qdf is a QueryDef.
I THINK the 2 set statements should be populating rst with a recordset that is the result of my query, and then assigning that recordset to my form.
Can anyone tell me where I am going wrong?
Thanks,
Keith.
I am trying to convert my application to ADO, and have a problem with assigning a recordset to the Recordset object of the form, in the Open event:
Code:
Dim qdf As ADODB.Command
Dim rst As ADODB.Recordset
-code to set up qdf with a query object and parameters etc-
Set rst = qdf.Execute
Set Me.Recordset = rst
(I know, I know, I should have changed the object names from the original DAO variables!)
This code produces the message:
"Run-time error '7965':
The object you entered is not a valid Recordset property."
The original code worked OK, where rst is a DAO recordset and qdf is a QueryDef.
I THINK the 2 set statements should be populating rst with a recordset that is the result of my query, and then assigning that recordset to my form.
Can anyone tell me where I am going wrong?
Thanks,
Keith.