I have inherited an access application front and backend and am converting it to sql server backend.
The code that opens a form is: [MainSub].SourceObject = "TurtleMain". This form in turn has several subforms. I have code like this to get records for each of the subforms:
Set rsFeeding = New ADODB.Recordset
With rsFeeding
Set .ActiveConnection = con
.Source = "spSubFeeding " & vTurtleID & " "
.LockType = adLockOptimistic
.CursorType = adOpenKeyset
.CursorLocation = adUseClient
.Open
End With
I want to be able to set the Recordset for the subform, but the code: Set Forms!Main!MainSub.Form!TurtleFeedingSub.Recordset = rsFeeding gives me an error of "object doesn't support this property or method."
What is the correct way to set the Recordset property?
Microsoft AccessVisual Basic Classic
Last Comment
dblankman
8/22/2022 - Mon
dblankman
ASKER
Here is a screenshot of the access form related to this question TurtleFEMain.png
dblankman
ASKER
I was able to get this to work by using: Set Forms!TurtleMain!TurtleSubEvent.Form.Recordset = rsEvent by opening "TurtleMain" in a separate window,but this breaks other code that is looking for Main![MainSub] syntax