I'm trying to use the below code for several forms to reference the data on the forms subform. However, it doesn't seem to like
Set rst = ctl.RecordsetClone
I'm sure it has something to do with the syntax. How should I be referencing this data? Thanks!
----------------------------------------------
Function Example()
Dim rst As Object
Dim ctl As Control
For Each ctl In Screen.ActiveForm.Controls
If ctl.ControlType = acSubform Then
Set rst = ctl.RecordsetClone
Exit For
End If
Next ctl
If rst.BOF And rst.EOF Then Exit Function
rst.MoveFirst
Do Until rst.EOF
DO STUFF REFERENCING RST
LOOP
End Function
Set rst = ctl.RecordsetClone
I'm sure it has something to do with the syntax. How should I be referencing this data? Thanks!
----------------------------------------------
Function Example()
Dim rst As Object
Dim ctl As Control
For Each ctl In Screen.ActiveForm.Controls
If ctl.ControlType = acSubform Then
Set rst = ctl.RecordsetClone
Exit For
End If
Next ctl
If rst.BOF And rst.EOF Then Exit Function
rst.MoveFirst
Do Until rst.EOF
DO STUFF REFERENCING RST
LOOP
End Function