0

Guy's i have this problem in my codes, it should be showing the form i choose when its successful its has no error but when i run it and log in successfully its terminating the program. Would you please help me identify the problem? thank you so much!

1
Contributor
1
Reply
2
Views
4 Years
Discussion Span
Last Post by jell28
0
 Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Dim ID As String
        ID = InputBox("Please Enter Employee ID.", "LOG IN")
        If ID = "I.T-110" Then
            MessageBox.Show("Log In Successful!") 'when Successful
            Form5.Show()
            Me.Close()
        Else
            MsgBox("Sorry Wrong ID Number,Please try again!")
            attempts += 1
        End If

        If attempts = 3 Then 'Closes the login form if the user credentials fail three times
            MessageBox.Show("You have reached the allowed number of login attempts")
            Me.Close()
        End If
    End Sub
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.