Change Password

  • Thread starter Dan message for David Ehrenreich
  • 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
 
G

Guest

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
 
D

Dan

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Dlookup 5
If Statements 2
Adding a counter to a loop 3
enable disable 2
I am not "getting" it.....DoCmd. OpenForm 4
Nested IF 7
FindFirst not finding first login/password attempt 1
DLookUp Trouble 3

Top