It is currently Tue Sep 01, 2026 2:35 pm


Access Code

Support for any program including installing and running

Moderator: liljim

Access Code

Postby venney » Tue Jan 17, 2006 5:08 pm

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
:)

"Float like a butterfly.
Sting like a bee.
Your hands can't hit
what your eyes can't see."
Muhammad Ali
User avatar
venney
Moderator
Moderator
 
Posts: 1757
Joined: Mon Jun 28, 2004 1:00 am
Location: Southampton - England
Operating System:

Thanks given:0
Thanks received:0
Top

Postby th3_d0n » Tue Jan 17, 2006 5:23 pm

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.
Image
User avatar
th3_d0n
Senior Geek
Senior Geek
 
Posts: 288
Joined: Sat Nov 20, 2004 1:00 am
Location: Southampton, England.

Thanks given:0
Thanks received:0
Top

Postby venney » Tue Jan 17, 2006 5:26 pm

Safe, cheers blood.

"Float like a butterfly.
Sting like a bee.
Your hands can't hit
what your eyes can't see."
Muhammad Ali
User avatar
venney
Moderator
Moderator
 
Posts: 1757
Joined: Mon Jun 28, 2004 1:00 am
Location: Southampton - England
Operating System:

Thanks given:0
Thanks received:0
Top

Postby Gecko » Wed Jan 18, 2006 1:00 am

Last edited by Gecko on Thu Jan 19, 2006 12:31 pm, edited 1 time in total.
User avatar
Gecko
Super Moderator
Super Moderator
 
Posts: 5209
Joined: Thu Oct 25, 2001 1:00 am
Location: Florida, USA

Thanks given:1
Thanks received:23
Top

Postby th3_d0n » Wed Jan 18, 2006 10:58 am

Image
User avatar
th3_d0n
Senior Geek
Senior Geek
 
Posts: 288
Joined: Sat Nov 20, 2004 1:00 am
Location: Southampton, England.

Thanks given:0
Thanks received:0
Top

Postby venney » Wed Jan 18, 2006 11:09 am


"Float like a butterfly.
Sting like a bee.
Your hands can't hit
what your eyes can't see."
Muhammad Ali
User avatar
venney
Moderator
Moderator
 
Posts: 1757
Joined: Mon Jun 28, 2004 1:00 am
Location: Southampton - England
Operating System:

Thanks given:0
Thanks received:0
Top


Return to Misc. Software

Who is online

Users browsing this forum: No registered users and 0 guests

cron