Change Password

  • Thread starter Thread starter Dan message for David Ehrenreich
  • Start date Start date
D

Dan message for David Ehrenreich

Hi David:

The way you said is working just fro the first psw and ui:

here is my code try to loop but still not working?

Please what am I missing:

Private Sub OK_Click()

If (DLookup("password", "PWTbl")) = Me.pw Then
If (DLookup("userid", "PWTbl")) = Me.UI Then

DoCmd.Close
stDocName = "Change Password"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
MsgBox "Incorrect Password"

End If

End If
With Me.RecordsetClone
..MoveFirst
If Not .EOF And .BOF Then
Do Until .EOF
..MoveNext
Next
End If
End With
End Sub


Thanks,

Dan
 
Dan,

So you were able to get it to work, but only for the
first Username and Password on the list. I'm not really
sure. I just started using Dlookup commands. I will
play with it, and if I figure something out I'll post it.

I do have a question though at the bottom of your code.
You have this. I'm not familiar with these instructions.

With Me.RecordsetClone
MoveFirst
If Not .EOF And .BOF Then
Do Until .EOF
...MoveNext
Next

What does this do?


David Ehrenreich
 
Thanks to Ted Allen, now is perfect!

Here is the statement:
Private Sub OK_Click()

If DLookup("password", "PWTbl", "UserID = '" & Me.UI
& "'") = Me.pw Then


DoCmd.Close
stDocName = "mainmenu"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
MsgBox "Incorrect Password"

End If



End Sub

Thanks, David

Dan
 
Back
Top