Page 1 of 1

Access Code

PostPosted: Tue Jan 17, 2006 5:08 pm
by venney
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
:)

PostPosted: Tue Jan 17, 2006 5:23 pm
by th3_d0n
I think you need a global variable, that will count the number of times you press log in.

I'll help you with it tomorrow in class. Well, try.

PostPosted: Tue Jan 17, 2006 5:26 pm
by venney
Safe, cheers blood.

PostPosted: Wed Jan 18, 2006 1:00 am
by Gecko

PostPosted: Wed Jan 18, 2006 10:58 am
by th3_d0n

PostPosted: Wed Jan 18, 2006 11:09 am
by venney