P
Peter McCartney
Hello All! A97 Thanking anyone for assistance.
For this I have a table called "Trego" with the fields:
1. ID - autonumber
2. Rego - number
3. Password - text - input mask set to password
4. Name - text
I have put the data in that is required for the above table that covers
these 5 users.
I want the 5 users to be able to change their own password themselves,
instead of me doing it.
The form I am using to change the password is called "fchange"
The fields on it are called, [Rego], [Password] with a unbound text box
called [newpassword].
With code:
************************************************
Private Sub Password_AfterUpdate()
Dim strfilter As String
strfilter = "Password = " & Me!Password
strfilter = "rego = " & Me!rego
If me!password = Dlookup("password", "trego",strfilter) And me!rego =
Dlookup("rego", "trego", strfilter) then
msgbox "ID confirmed. Enter new Password!"
Docmd.GotoControl "Newpassword"
End if
End sub
***********************************************
The user then enters their new password.
The unbound textbox [newpassword] has the code in the afterupdate section
***********************************************
Me!Password = Me!Newpassword
***********************************************
Now! when the user gets a verification that both [rego] & [password] are
correct, I need to be able to change the existing data, not add another
record. Perhaps a SQL statement, but I am unsure of how to do it.
Peter McCartney
For this I have a table called "Trego" with the fields:
1. ID - autonumber
2. Rego - number
3. Password - text - input mask set to password
4. Name - text
I have put the data in that is required for the above table that covers
these 5 users.
I want the 5 users to be able to change their own password themselves,
instead of me doing it.
The form I am using to change the password is called "fchange"
The fields on it are called, [Rego], [Password] with a unbound text box
called [newpassword].
With code:
************************************************
Private Sub Password_AfterUpdate()
Dim strfilter As String
strfilter = "Password = " & Me!Password
strfilter = "rego = " & Me!rego
If me!password = Dlookup("password", "trego",strfilter) And me!rego =
Dlookup("rego", "trego", strfilter) then
msgbox "ID confirmed. Enter new Password!"
Docmd.GotoControl "Newpassword"
End if
End sub
***********************************************
The user then enters their new password.
The unbound textbox [newpassword] has the code in the afterupdate section
***********************************************
Me!Password = Me!Newpassword
***********************************************
Now! when the user gets a verification that both [rego] & [password] are
correct, I need to be able to change the existing data, not add another
record. Perhaps a SQL statement, but I am unsure of how to do it.
Peter McCartney