Validation Rule

M

Markus

Hallo

I hope some one can help me I want to validate the first 5 characters of a
text box with the a different text box. If they match that its ok if not I
want a msgbox to give me a error but only the first 5 have to be the same

Regards
Markus
 
S

Stefan Hoffmann

hi Markus,
I hope some one can help me I want to validate the first 5 characters of a
text box with the a different text box. If they match that its ok if not I
want a msgbox to give me a error but only the first 5 have to be the same

If Len(DifferentTextBox.Value) > 4 Then
If Len(TextBox.Value) < 5 Then
MsgBox "No match, to few characters."
Else
If Left(TextBox.Value, 5) = Left(DifferentTextBox.Value, 5) Then
MsgBox "Yeah, match."
Else
MsgBox "Uh, no match."
End If
End If
Else
MsgBox "Cannot match against DTB, to few characters."
End If


mfG
--> stefan <--
 
M

Markus

Thank you it works

Stefan Hoffmann said:
hi Markus,


If Len(DifferentTextBox.Value) > 4 Then
If Len(TextBox.Value) < 5 Then
MsgBox "No match, to few characters."
Else
If Left(TextBox.Value, 5) = Left(DifferentTextBox.Value, 5) Then
MsgBox "Yeah, match."
Else
MsgBox "Uh, no match."
End If
End If
Else
MsgBox "Cannot match against DTB, to few characters."
End If


mfG
--> stefan <--
 
Top