Hi
I have a code below. Is there a way were the macro skip or not focus on invisible textbox
And i dont want to change the name of the textbox
Macro below
Dim ctrl As Control
Dim EntryRequired As Boolean
For Each ctrl In Me.Frame161.Controls
Select Case TypeName(ctrl)
Case "TextBox", "ComboBox"
If Not EntryRequired Then
EntryRequired = CBool(Len(ctrl.Text) = 0)
If EntryRequired Then ctrl.SetFocus
End If
ctrl.BackColor = IIf(Len(ctrl.Text) = 0, &HC0C0FF, vbWhite)
End Select
Next
If EntryRequired Then
MsgBox "Please fill the Info above to proceed", 48, "Entry Required"
End If
I have a code below. Is there a way were the macro skip or not focus on invisible textbox
And i dont want to change the name of the textbox
Macro below
Dim ctrl As Control
Dim EntryRequired As Boolean
For Each ctrl In Me.Frame161.Controls
Select Case TypeName(ctrl)
Case "TextBox", "ComboBox"
If Not EntryRequired Then
EntryRequired = CBool(Len(ctrl.Text) = 0)
If EntryRequired Then ctrl.SetFocus
End If
ctrl.BackColor = IIf(Len(ctrl.Text) = 0, &HC0C0FF, vbWhite)
End Select
Next
If EntryRequired Then
MsgBox "Please fill the Info above to proceed", 48, "Entry Required"
End If