Change Password

S

SJH

I have a form with three fields, username, pwd and confirmpwd (last two being
a password inputmask). When a changepwd button is pressed on the form I want
Access to change the currentusers pwd (I will default the username to
currentuser).
I have seen the suggested code:

DbEngine.Workspaces(0).Users("UserName").NewPassword "OldPassword",
"NewPassword"

but I am unsure how to code this to the button - i presume this alone
doesn't work! Sorry, I am not very advanced on coding... any help would be
most appreciated.
Thanks
Sue
 
J

Joan Wild

SJH said:
I have a form with three fields, username, pwd and confirmpwd (last
two being a password inputmask).

You mean you have three controls with those names, right?
When a changepwd button is pressed
on the form I want Access to change the currentusers pwd (I will
default the username to currentuser).
I have seen the suggested code:

DbEngine.Workspaces(0).Users("UserName").NewPassword "OldPassword",
"NewPassword"

but I am unsure how to code this to the button - i presume this alone
doesn't work! Sorry, I am not very advanced on coding... any help
would be most appreciated.

Did you try it? Actually it should work just fine. Assuming the control
names above, in the click event for the changepwd command button..
DbEngine.Workspaces(0).Users(Me!username).NewPassword Me!pwd, Me!confirmpwd
 
S

SJH

Yes i tried it but it comes up with an error Object Required OK. Do I need to
incorporate the old password too? At the moment I have:

db.engine.Workspace(0).Users(Me!Username).NewPassword , Me!NewPwd,
Me!ConfirmPwd

which doesn't use the old password. Just user name, new password and confirm
password.

Cheers
Sue
 
J

Joan Wild

SJH said:
Yes i tried it but it comes up with an error Object Required OK. Do I
need to incorporate the old password too? At the moment I have:

db.engine.Workspace(0).Users(Me!Username).NewPassword , Me!NewPwd,
Me!ConfirmPwd

which doesn't use the old password. Just user name, new password and
confirm password.

Yes you need to supply the old password. I believe you said that was in a
control named pwd.
 
Top