stopher
AWF VIP
- Local time
- Today, 20:24
- Joined
- Feb 1, 2006
- Messages
- 2,388
Taking MarkK's code we can eliminate the collection and just reference the container relevant to the subform:
Code:
Private subCont As Control
Private Sub Form_Load()
Dim ctrl As Control
For Each ctrl In Me.Parent.Controls
'find the subform, and reference it
If ctrl.ControlType = acSubform Then
If ctrl.Form Is Me Then
Set subCont = ctrl
Exit For
End If
End If
Next
End Sub