Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / March 2005

Tip: Looking for answers? Try searching our database.

Failed login after 3 attempts

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DubboPete - 16 Mar 2005 12:03 GMT
Hi all,

Does anyone have a quick bit of code to open a form when a user fails to log
on after attempting three times?

Login form is simply

Username?
password?

then something like...

   'on third count of failed password
   If Not (Me![password] = [password] Then
       Docmd.OpenForm "PasswordReminder"
   End if

tia

DubboPete
Jeff Conrad - 16 Mar 2005 18:58 GMT
> Does anyone have a quick bit of code to open a form when a user fails to log
> on after attempting three times?
[quoted text clipped - 10 lines]
>         Docmd.OpenForm "PasswordReminder"
>     End if

I did something like this for a client application a long time ago.
If you are using Access User Level Security this is not possible because
the login form appears before ANY VBA code runs in the database. If,
however, you create your own login "system" then yes, you can do this.
It sounds like you have done this.

I could post all the code behind the login button on the form, but it may
be a little confusing with all the other stuff it is doing. There are many,
many ways to do this, but here is what I did:

1. Made a hidden textbox on the form called CheckAttempts with a
default value of 1. When the form opens it has a value of 1.

2. Ran my code to verify their User Name/Password.

3. If there was no match in the tblUsers then I did a Select Case on
the value of CheckAttempts. Something along these lines:

Select Case Me.CheckAttempts
   Case 1
      ' Gave them a message here
      ' Increment the value
       Me.CheckAttempts = 2
   Case 2
      ' Gave them another message here
      ' Increment the value again
       Me.CheckAttempts = 3
   Case 3
       ' Third and final attempt. You're outta here now buddy
       ' Last message
       DoCmd.Quit
   Case Else
       ' Should not get here
End Select

Just modify something like the above to suit your needs.

Hope that helps,
Signature

Jeff Conrad
Access Junkie
Bend, Oregon

DubboPete - 17 Mar 2005 07:41 GMT
Simple yet very effective...

thanks Jeff, gonna try it soon...

DubboPEte

>> Does anyone have a quick bit of code to open a form when a user fails to
>> log
[quoted text clipped - 51 lines]
>
> Hope that helps,
Jeff Conrad - 17 Mar 2005 17:19 GMT
You're welcome, glad to help.

Signature

Jeff Conrad
Access Junkie
Bend, Oregon

> Simple yet very effective...
>
> thanks Jeff, gonna try it soon...
>
> DubboPEte

> >> Does anyone have a quick bit of code to open a form when a user fails to
> >> log
[quoted text clipped - 51 lines]
> >
> > Hope that helps,
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.