This is not working and for my life I can't figure out why:
Private Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim firstLetter As String
firstLetter = empIDtextBox.Text.Remove(1, 3)
firstLetter = firstLetter.ToUpper()
Label2.Text = firstLetter
If firstLetter <"F" Or firstLetter <"P" Then
Dim button As DialogResult
button = MessageBox.Show("First letter must be F or P!", _
"Error Message", MessageBoxButtons.OK,
MessageBoxIcon.Error, _
MessageBoxDefaultButton.Button1)
If button = Windows.Forms.DialogResult.OK Then
empIDtextBox.Text = ""
empIDtextBox.Focus()
End If
End If
End Sub
End Class
The program is much more complex but I can't even get this part to
work. The input is a 4 character string such as "f123"
It should strip out the last 3 characters and change the first letter
to upper case.
If I take out the "Or firstLetter <"P" " then it's ok.
Label2 outputs the correct letter of "F" but still gives me an error
message.
"f123" should work and so should "p123"
My brain is thinking if firstLetter is not F or firstLetter is not P
then give error message, but that ain't workin' for me.
TIA,
Max