Password Problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ATCU
    New Member
    • Feb 2008
    • 1

    Password Problem

    Originally posted by NeoPa
    Charlie,

    So near to the end, is it a good time to give up?
    Try posting your whole procedure exactly as it is now for me please.
    I'm sure we can get this working for you (well pretty confident anyway).
    Some of these syntax problems can be hard to find but I've had some experience with some doozers in my time - lets give it a try.

    Hello NeoPa,

    I am having the same probelm, but cannot get the code to verify the user's old password in order to enter a new password. If you could look over it, that would be great. Thanks.
    Code:
    Private Sub txtPassword_AfterUpdate()
    Dim pswd As String
    Dim confirm As String
    
        pswd = DLookup("[strEmpPassword]", "tblUsers", "[IngEmpID]=" & txUser)
     
      If pswd = "password" Then
     
    EnterPassword:
     
        pswd = InputBox("Please enter a new password", "Change Password")
        confirm = InputBox("Please new password again.", "Password Confirmation")
        If pswd <> confirm Then
         MsgBox "Passwords do not match.", vbOKOnly
         GoTo EnterPassword
        Else
         DoCmd.RunSQL "UPDATE tblUsers   SET [strEmpPassword]]= '" & Me.pswd & "' WHERE [txtUser]='" & Me.txtUser & "';"
        End If
      Else
         'Your normal password checking code here
      End If
     
    End Sub
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32656

    #2
    Originally posted by ATCU
    Hello NeoPa,

    I am having the same probelm, but cannot get the code to verify the user's old password in order to enter a new password. If you could look over it, that would be great. Thanks.
    Code:
    Private Sub txtPassword_AfterUpdate()
    Dim pswd As String
    Dim confirm As String
    
        pswd = DLookup("[strEmpPassword]", "tblUsers", "[IngEmpID]=" & txUser)
     
      If pswd = "password" Then
     
    EnterPassword:
     
        pswd = InputBox("Please enter a new password", "Change Password")
        confirm = InputBox("Please new password again.", "Password Confirmation")
        If pswd <> confirm Then
         MsgBox "Passwords do not match.", vbOKOnly
         GoTo EnterPassword
        Else
         DoCmd.RunSQL "UPDATE tblUsers   SET [strEmpPassword]]= '" & Me.pswd & "' WHERE [txtUser]='" & Me.txtUser & "';"
        End If
      Else
         'Your normal password checking code here
      End If
     
    End Sub
    I'm not happy with this.

    Firstly you are hijacking a thread. Not allowed.
    Secondly, you were not prepared to phrase your question but rather expect me to dig through a >1 year old thread (19 posts) to work out what your question might be.
    Lastly, we are not a code checking service. We are here to help you learn.

    If you would like to post again (in here - I'm splitting the thread for your question) explaining the problem and what your specific question is ("Here's a whole bunch of code - please fix it." just doesn't do it I'm afraid), then we can look at helping you.

    I appreciate that this is your first post so I'm bearing that in mind and will take no further action at this time. If you're to make more use of these facilities though, I suggest you have a look at the posting guidelines. There's a link at the top right of every page called Help.

    PS. The other thread is Login Forms.

    Comment

    Working...