Results 1 to 2 of 2
  1. #1
    papa yaw is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2012
    Posts
    4

    Login form is not working properly

    The ltogin form works, that is if your use name is wrong you denied access however the problem is that if your user name is correct and the password enterd is not for that particular user name but for another one access is granted. The code is below


    Me.EmployeeId = Nz(DLookup("strEmployeeid", "tblEmployee", "StrEmployeeId='" & Me.EmployeeId & "'"), "")


    Password = Nz(DLookup("strPassword", "tblEmployee", "StrPassword='" & Me.Password & "'"), "")
    If Me.EmployeeId = strEmployeeId And Me.Password = strPassword Then

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,951
    Using the wrong criteria for the password lookup. And the If condition is wrong.

    Dim EmployeeID As String, Password As String
    If Not IsNull(Me.EmployeeID) And Not IsNull(Me.Password) Then
    EmployeeId = Nz(DLookup("strEmployeeid", "tblEmployee", "StrEmployeeId='" & Me.EmployeeId & "'"), "")
    Password = Nz(DLookup("strPassword", "tblEmployee", "StrEmployeeID='" & Me.EmployeeID & "'"), "")
    If Me.EmployeeID = EmployeeID And Me.Password = Password Then
    'do something
    Else
    'do this
    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.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. UDF Referencing Excel Not Working Properly
    By JoeM in forum Programming
    Replies: 7
    Last Post: 09-27-2012, 12:20 PM
  2. NotInlist Event not working properly
    By thanosgr in forum Programming
    Replies: 2
    Last Post: 06-14-2012, 01:46 PM
  3. access program not working properly!
    By accesshelpme in forum Access
    Replies: 1
    Last Post: 05-13-2012, 03:43 PM
  4. Count or DCount Not Working Properly
    By Chris1112 in forum Forms
    Replies: 3
    Last Post: 05-09-2012, 02:51 PM
  5. Login form code not working
    By dharmacloud in forum Forms
    Replies: 11
    Last Post: 08-22-2011, 03:08 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