I need to record all control captions on a many main forms with nested forms. If I can obtain the form names of the nested forms I know how to access the controls of each form. e.g. Forms!Form1!Form2!Form3.Controls, where each of these Forms is nested. Form1 is main.
when I try:
Private Sub Command10_Click()
For Each Control In Me.Controls
Debug.Print Control.Name
If Control.ControlType = acSubform Then ' Find subforms on mainform
Debug.Print Control.Name
End If
Next
End Sub
Debug.print shows controls and only lists Form2, but not Form3
Is there a way to use vba to get the ALL the form names nested within Form1?
Thank you
Mike