Access Code
Hello, in Acces I have a log in system. It works with Dlookup. Here is my code
Private Sub button_Click()
Dim x
x = DLookup("[Password]", "Manager Login", "[Username] = [username1]")
If x = [password1] Then
MsgBox "Welcome"
DoCmd.Close
DoCmd.OpenForm ("Manager Main Page")
Else
MsgBox "Sorry incorrect"
End If
End Sub
How can do i get it so that if you log type in incorrect login details say 3 times, it closed the form. I know DoCmd.quit quits the program but i want it to do that when you get it wrong 3 times.
Help would be appreciated. Thanks
Venney

Private Sub button_Click()
Dim x
x = DLookup("[Password]", "Manager Login", "[Username] = [username1]")
If x = [password1] Then
MsgBox "Welcome"
DoCmd.Close
DoCmd.OpenForm ("Manager Main Page")
Else
MsgBox "Sorry incorrect"
End If
End Sub
How can do i get it so that if you log type in incorrect login details say 3 times, it closed the form. I know DoCmd.quit quits the program but i want it to do that when you get it wrong 3 times.
Help would be appreciated. Thanks
Venney
