Dim ctrl, ctrl2 As Control
For Each ctrl In Me.Controls
If (TypeOf (ctrl) Is GroupBox) Then
Dim miGroup As GroupBox
miGroup = DirectCast(ctrl, GroupBox)
For Each ctrl2 In miGroup.Controls
If (TypeOf (ctrl2) Is TextBox) Then
Dim miTextBox As TextBox
miTextBox = DirectCast(ctrl2, TextBox)
MsgBox(miTextBox.Name)
End If
Next
End If
If (TypeOf (ctrl) Is TextBox) Then
Dim miTextBox As TextBox
miTextBox = DirectCast(ctrl, TextBox)
MsgBox(miTextBox.Name)
End If
Next