Mega Code Archive

 
Categories / VisualBasic Script / Forms
 

Determining the Type of a Control

Sub FlipEnabled(frmAny As Form, ctlAny As Control)     Dim ctl As Control     ctlAny.Enabled = True     ctlAny.SetFocus     For Each ctl In frmAny.Controls         If ctl.ControlType = acCommandButton Then             If ctl.Name <> ctlAny.Name Then                 ctl.Enabled = Not ctl.Enabled             End If         End If     Next ctl End Sub