Quote:
Why do all three if statements get executed every time?
That is what you requested in your code.
Try this:
Public Class WELCOME
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If TextBox1.Text = "EMPLOYEE" And TextBox2.Text = "PASSWORD" Then
Me.Hide()
PROBLEMS.Show()
ElseIf TextBox1.Text = "EMPLOYEE" And TextBox2.Text IsNot "PASSWORD" Then
MessageBox.Show("Incorrect Password")
ElseIf TextBox1.Text IsNot "EMPLOYEE" And TextBox2.Text = "PASSWORD" Then
MessageBox.Show("Incorrect User Id")
End If
End Sub
End Class
the use of ElseIf ensure that only one if will be executed, it don't ensure that your logic is correct.