Mollethewizard
IS-IT--Management
I’ve got a user form with a TextBox that I would the user to either leave empty or state a value according to the given mask.
How can I increase the code below so both criteria’s will be accepted?
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If Not TextBox1.Text Like "######-####" Then
MsgBox ("Wrongly stated!")
Cancel = True
End If
End Sub
Christer
How can I increase the code below so both criteria’s will be accepted?
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If Not TextBox1.Text Like "######-####" Then
MsgBox ("Wrongly stated!")
Cancel = True
End If
End Sub
Christer