-
is there a property in the control that says what TYPE of control it is? I am using a routine that traps the ACTIVE CONTROL but I only want the routine to run if the active control is a TEXT BOX.. how would someone go about doing that? thanks for the help.
Thai
-
Try something like this.
Code:
Private Function IsTextBox(obj As Object) As Boolean
Dim objTemp As TextBox
On Error GoTo Err_NotTextbox:
Set objTemp = obj
IsTextBox = True
Exit Function
Err_NotTextbox:
IsTextBox = False
End Function
this returns true if obj is a text box and false if it isn't
Hope this helps
-
Dim cntl_Nitro As Control
Private Sub Form_Load()
For Each cntl_Nitro In Form1.Controls
If (Not TypeOf cntl_Nitro Is TextBox) Then
cntl_Nitro.Font = "Time New Roman"
cntl_Nitro.Font.Bold = True
cntl_Nitro.Font.Size = 14
End If
Next
end sub