Page 2 of 2 FirstFirst 12
Results 16 to 22 of 22
  1. #16
    glen is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    171
    No not working.

  2. #17
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Doesn't work because the variable LogonAttempts is reset to 0 for each click of the button. Must declare the variable in the module header:
    Option Compare Database
    Option Explicit
    Dim LogonAttempts As Integer

    Then change end of the procedure to:
    Code:
        'Check to see if data is entered into the UserName combo box
        LogonAttempts = LogonAttempts + 1
        If Me.TXTPASSWORD.Value = DLookup("strEmpPassword", "tblEmployees", _
                "[lngEmpID]=" & Me.cboemployee.Value) Then
            lngMyEmpID = Me.cboemployee.Value
            'Close logon form and open splash screen
            DoCmd.Close acForm, "Logon", acSaveNo
            DoCmd.OpenForm "switchboard"
        Else
            If LogonAttempts = 3 Then
                MsgBox "You do not have access to this database.Please contact admin.", _
                         vbCritical, "Restricted Access!"
                Application.Quit
            Else
                MsgBox "Password Invalid. Please Try Again", vbOKOnly, _
                    "Invalid Entry!"
                Me.TXTPASSWORD.SetFocus
            End If
        End If
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #18
    glen is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    171
    Yes now working.
    But the other problem is still exist.
    That before login I should not have permission to go inside database.
    Bcoz the login splash screen still on the screen and I didn't signed in but still I can go inside database.

  4. #19
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    All I can do is refer you back to posts #8 and 10.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #20
    glen is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    171
    Now another problem occur.
    If Password mismatch three times then it work and close the database.
    But if User and Password match then this error come which I attached in Pic.

  6. #21
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    That does not happen in the db I have.

    You need to learn how to debug code. Refer to the link at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #22
    glen is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    171
    Solved Now. Thanks
    I feeling shy to ask again and again but really I didn't get this post no. 8 and 10.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. HELP>Access 2010 User Login Form Code.
    By zaaimanm in forum Programming
    Replies: 5
    Last Post: 10-22-2012, 07:28 PM
  2. User Login
    By winterh in forum Forms
    Replies: 6
    Last Post: 03-14-2012, 06:01 PM
  3. Multi- User Login
    By Tom Lovick in forum Access
    Replies: 1
    Last Post: 02-11-2012, 12:20 PM
  4. Replies: 1
    Last Post: 12-11-2011, 11:48 AM
  5. Replies: 3
    Last Post: 09-22-2011, 03:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums