R
Ryan H
I have a sub (ClearUserform) that is called by several userforms. Sometimes
the control may not be on the userform passed to ClearUserform, thus I get an
error. So I added the On Error Resume Next statement to quickly work around
the error. Is there a way to test if the control exists on the userform
passed to the sub.
Sub MySub()
Call ClearUserform(Userform1)
End Sub
Sub ClearUserform(MyForm As UserForm)
On Error Resume Next
MyForm.TextBox1 = ""
' i have other controls list here
On Error GoTo 0
End Sub
the control may not be on the userform passed to ClearUserform, thus I get an
error. So I added the On Error Resume Next statement to quickly work around
the error. Is there a way to test if the control exists on the userform
passed to the sub.
Sub MySub()
Call ClearUserform(Userform1)
End Sub
Sub ClearUserform(MyForm As UserForm)
On Error Resume Next
MyForm.TextBox1 = ""
' i have other controls list here
On Error GoTo 0
End Sub