Change passowrd

  • Thread starter Thread starter Dan
  • Start date Start date
D

Dan

Hi:

I know this is not simple...

I would need a way (not built-in Access security) that the
users through a form and a table I think, change the user
name and password. Now I have an OK button with a code
and if statements that check the user name and psw that I
have assigned...

But this is not very good if they want to change it...

Graciously,

Dan
 
I wanted the same thing for one of my forms so here is
what I did

First I made a table called PWTbl w/ one field called
password . No key or anything else.

Now for the form with the password.
Make the recodeset based off the PWtbl and create an
UNBOUND feild. Change the name of the field to PW not
the control.

Now create a command button. Dont use the wizard.
Change the name of the command button to SubmitCmd
Also, create a command button that just closes the screen
in case they dont know the password.

Then on the On Click Event Expression enter this

Private Sub SubmitCmd_Click()
If (DLookup("password", "PWTbl")) = Me.PW Then
DoCmd.close
stDocName = "YOUR FORM YOU WANT TO OPEN"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
MsgBox "Incorrect Password"

End If
End Sub

Now for changing the password. I did it this way. I made
an options form that allows the user to change many
things with the database without going into the design
views or backend.

In that options form I made a sub-form based of the PwTbl
in a datasheet view that allows the user to add, change
or delete their password. You can have as many passwords
as you want.

Hope this helps

David Ehrenreich

Hope this helps
 
Thank you, so much, David!

I will try it right now...Sorry if I ask too much! Can the
user name be changed in the same way?!

Thanks again,

Dan
 
Back
Top