This Sample To loop the individual controls
Code:For a = 1 To Me.Controls.Count ObjName = Me.Controls(a - 1).Name ActiveName = ActiveControl.Name ObjIndex = "" ActiveIndex = "" On Error Resume Next ObjIndex = Me.Controls(a - 1).Index ActiveIndex = ActiveControl.Index On Error GoTo 0 If ObjIndex <> "" Then MsgBox Me.Controls(ObjName)(ObjIndex).Name Me.Controls(ObjName)(ObjIndex).Enabled = False Else MsgBox Me.Controls(ObjName).Name If TypeName(Me.Controls(objname)) = "CommandButton" Then MsgBox "This Is Command Button" End If 'MsgBox Me.Controls(a - 1).Name Next a




Reply With Quote