Validation Rule

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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 <--
 
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 <--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top