Discussion Locked

Check a string in Outlook Custom form

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have a form and I need to check a value entered.
The example would me E30 or W40. I need to check the beginning of the entry to have the form put a value into another box. So I need to see if the first entry begins with E or W
If begins with Edo this ?

What command can I use to check this with.

3 replies

by madestroitsolutions

Replace the following things on the code below:

Text1 = Input TextBox : This box receives the input from user (this is where they type)

Text2 = Result TextBox: This box receives the result of the check (E or W)

-----------------------------------------------

Select Case UCase(Mid(text1.Text, 1, 1))

Case "E"
text2.Text = "E"
Case "W"
text2.Text = "W"
Case Else
text2.Text = "N/A"
End Select

--------------------------------

Put this code into an event, so that it fires when you need it to check what they have entered. If you are not interested in the whole code, simply pay attention to the first line, that is the command you are looking for (MID)

[Mid] Syntax:
Mid(string,start,length) as string

Good luck!

This discussion is closed to new replies.