I am trying to use the following to check each Textbox in a user form
but I am getting a Type Mismatch error on
I am struggling to see what is wrong here as from looking at several forums, this is suggested a number of times of how to loop through user form controls.
TIA
Code:
Private Sub CheckForm()
Dim ctlText As Control
Application.ScreenUpdating = False
btnAmend.Enabled = False
For Each ctlText In frmAmend.Controls
If TypeName(ctlText) = "TextBox" Then
If ctlText <> "" Then
btnAmend.Enabled = True
Else
End If
End If
Next ctlText
Application.ScreenUpdating = True
End Sub
Code:
For Each ctlText In frmAmend.Controls
TIA