Article ID: 190043
Article Last Modified on 5/12/2003
Private Sub Form_Load()
Dim x As Control
Dim y As Boolean
Controls.Add "vb.commandbutton", "a"
Controls.Add "vb.commandbutton", "b"
Controls.Add "vb.commandbutton", "c"
Controls.Add "vb.commandbutton", "d"
Controls.Add "vb.commandbutton", "e"
Controls.Add "vb.commandbutton", "f"
For Each x In Controls
Select Case x.Name
Case "d", "e", "f"
Controls.Remove x
End Select
Debug.Print x.Name
Next
End Sub
Private Sub Form_Load()
Dim x As Control
Dim y As Boolean
Controls.Add "vb.commandbutton", "a"
Controls.Add "vb.commandbutton", "b"
Controls.Add "vb.commandbutton", "c"
Controls.Add "vb.commandbutton", "d"
Controls.Add "vb.commandbutton", "e"
Controls.Add "vb.commandbutton", "f"
For Each x In Controls
Select Case x.Name
Case "d", "e", "f"
Controls.Remove x
End Select
Next
For Each x In Controls
Debug.Print x.Name
Next
End Sub
Keywords: kbprb KB190043