Can someone please point me in the direction of the TechHelp video Richard did where he constructed a UserT? I'd like to rewatch it and see if he talks about how to track the first time a user logs into the database. Thanks!
I think that's it Kevin. I realized just now that what I am trying to add to it is something in the code of the LogonBtn On Click event... Currently it checks for the last time a user's password was changed using this:
DateChaged = Nz(DLookup("DateChanged", "UserT", "Username=""" & TempVars("Username") & """"), #1/1/1990#)
If Date - DateChaged > 90 Then
MsgBox "Your password is more than 90 days old and must be changed now."
DoCmd.OpenForm "PasswordChangeF"
Else
DoCmd.OpenForm "Main Menu"
End If
I'd like to add in there somewhere for it to check if a new column I've added to the UserT ("FirstLogon") is null so that if it is, some other code can be run elsewhere.
Daniel GoldenOP
@Reply 3 months ago
Also, this is the code that runs in the passwordChangeF so I assume something like this would have to be added in somewhere:
Private Sub UpdateBtn_Click()
Password2.SetFocus
If IsNull(Password1) Then MsgBox ("Password 1 missing"): Exit Sub
If IsNull(Password2) Then MsgBox ("Password 2 missing"): Exit Sub
If Password1 <> Password2 Then MsgBox ("Passwords don't match!"): Exit Sub
If IsNull("UserT!FirstLogon") Then
UserT!FirstLogon = Date
End If
but it does not work.
Kevin Robertson
@Reply 3 months ago
You need to look up the value of the field in the table. The code below assumes there is a record. You may need more if the user doesn't exist. I hard coded the UserID for simplicity and testing purposes.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
TechHelp.
The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.