User Input Form (1 Viewer)

TheSafetyGuy86

Registered User.
Local time
Today, 05:10
Joined
Jun 18, 2013
Messages
31
Good Day!

I am working on a database that uses a form requiring personnel to log in. This information comes from a user table and is something that I have added on numerous occasions to various databases. The question I have is in relations to a "lockout." How do I set it up so that someone gets locked out after so many attempts loging in on this form? If this is the wrong place for the question, I apologize, but I thought it was a part of the form. Have a great day!

TheSafetyGuy
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 02:10
Joined
Aug 30, 2003
Messages
36,132
Typically a form level variable that you increment with each failed attempt. In your code you test that variable and if it's greater than whatever, kick them out.
 

TheSafetyGuy86

Registered User.
Local time
Today, 05:10
Joined
Jun 18, 2013
Messages
31
Pbaldy,

Thanks for the reply, is there any way that you can elaborate on this a bit. I am not new, but I am not expert either haha. I appreciate the help.
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 02:10
Joined
Aug 30, 2003
Messages
36,132
What is it you need help with? Declaring a form level variable, incrementing a variable, or testing one?
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 02:10
Joined
Aug 30, 2003
Messages
36,132
At the appropriate points in your code:

Dim VariableName As Integer

VariableName = VariableName + 1

If VariableName > 3 Then
 

TheSafetyGuy86

Registered User.
Local time
Today, 05:10
Joined
Jun 18, 2013
Messages
31
Pbaldy,

Thanks! That makes much more sense seeing it in front of me. Now just to play around with the code a bit and see where it fits. I appreciate your time.

Safety Guy
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 02:10
Joined
Aug 30, 2003
Messages
36,132
No problem, post back with your code if you get stuck. Stay safe. :p
 

burrina

Registered User.
Local time
Today, 04:10
Joined
May 10, 2014
Messages
972
Here is an Example.
' Validate user password and count user pw entry attempts
If DLookup("[pw]", "tblUserSecurity_Sec", "[UserID]='" & Me.txtUserID.Value & "'") <> Me.txtPW.Value Then
Me.PWChk.Value = Me.PWChk.Value + 1
If Me.PWChk.Value > 3 Then
MsgBox "You may not make more than three Password entry attempts.", vbCritical + vbOKOnly, "Oops!"
DoCmd.Quit
End If
MsgBox "The Password for " & Me.txtUserID.Value & " is incorrect." & vbCrLf & _
"Please enter your correct Password or contact your Application " & _
"Administrator.", vbOKOnly, "Password for " & Me.txtUserID.Value & " Incorrect"


HTH
 

Users who are viewing this thread

Top Bottom