Hi All,
I am trying to make my login form ask the user to update his/her password when they initially log in. The new password entered will be good for 90 days. How do I do this? Please give example (visual learner).
Hi All,
I am trying to make my login form ask the user to update his/her password when they initially log in. The new password entered will be good for 90 days. How do I do this? Please give example (visual learner).
You'd have to put a startdate and/or termination date on the login record and check that date against the current date to see if it has expired. If your usernames/passwords are being stored in a table in your database that would be the likely place to store the expiration date of the password. If you want to do something fancier, like keep track of all the passwords they have ever used so they can't use the same one again, you would need a secondary table that contained the PK (primary key) to the user table as a FK (foreign key) another unique identifier and the 'old' passwords with their expiration dates.
sweet! i'll give that a try and see if works. Thanks!!
Here is my login script. Where would I input the date/time for this to happen. Also I've added two fields in my login table; one is titled DateUpdated and the other is title ExpiredDate. Please advise.
Private Sub OK_Click()
If IsNull(Me.loginID.Value) = True Then
MsgBox "Please enter LoginID", vbInformation, "LoginID Required"
Me.loginID.SetFocus
ElseIf IsNull(Me.Password.Value) = True Then
MsgBox "Please enter Password", vbInformation, "Password Required"
Me.Password.SetFocus
Else
'process the job
If (IsNull(DLookup("LoginID", "Login and Password", "LoginID = '" & Me.loginID.Value & "'"))) Or _
(IsNull(DLookup("Passwords", "Login and Password", "Passwords = '" & Me.Password.Value & "'"))) Then
MsgBox "Incorrect LoginID or Password", vbCritical, "ERROR"
Else
DoCmd.OpenForm "Apogee Payment Systems", acNormal, , , acFormAdd
DoCmd.Close acForm, "Login"
End If
End If
End Sub
where you put it depends totally on what you want your mechanic to be.
Do you want to prevent them from logging in until they change it?
Do you want to allow them to log in but be directed to a place to change their password?
Do you want to allow them to change their password in the main login screen?
If you have a specific form where they can change their login information (you want to make sure you hide the two date fields you mentioned so the users can't alter them) then I would put the date check portion of the login in the last ELSE loop check the date there like:
Code:if date > dlookup("[ExpiredDate]", "Login and Password", "[LoginID] = '" & loginID & "'") then 'do what you normally do else ' put in the code to direct them to enter a new password here endif
I want to prevent them from logging in until they change it. I also would like to allow them to change it from the main login screen. would this make the code you gave different?
if you want them to change it from the main form you will have to provide two new fields for the new password/confirm new password
In other words on a successful login but an expired password you would make the two 'new password' fields visible then confirm the changes (compare the two passwords first to make sure they are identical when you click a 'update password' button. The short answer is yes, the code would be in the same spot you just have to figure out the ELSE part of that statement.
rpeare you're awesome. I actually understand what you mean. lol.. I might how have to hit you up again to make I am entering the code correctly. I sometimes get stumped on how to write them. Thanks again.