Jonny45wakey
Member
- Local time
- Today, 14:50
- Joined
- May 4, 2020
- Messages
- 40
Hi I have one final hurdle left in the development of my MS Access Project Management Database, essentially i have a table displayed in a form (frmUser_DS) which contains the database users, the fields in this table are as follows:-
UserID
UserName
UserLogin
EmpPassword
PCName
UserSecurity
IssueDate
ExpireDate
Flag
When a new user is added the "Issue Date" logs todays date and the After Update code adds 12 months to the "Issue Date" and populates the "Expire Date" field.
Hidden on the form is an unbound text box "txtFlagTime" which has the "=Now()" in the Default value field.
What i am looking to automate using VBA is that when the database is opened the VBA opens the form "frmUser_DS" and as the date updates in "txtFlagTime" the code updates the "UserSecurity" field with "INVALIDATED" if the date in the "txtFlagTime" field has exceeded the "ExpireDate" fields date.
This should be a hidden routine which runs on database opening to validate user expiry date and if their expiry date has passed their user security is set to INVALIDATED
I have code in the "Flag" field under On Got Focus which is:- If Me.Flag.Value = "Expired" Then Me.UserSecurity.Value = 4 4 is the Security ID which = "INVALIDATED"
This works if you click the field manually but i cannot get this to automatically update
Any ideas welcomed
Jonny
UserID
UserName
UserLogin
EmpPassword
PCName
UserSecurity
IssueDate
ExpireDate
Flag
When a new user is added the "Issue Date" logs todays date and the After Update code adds 12 months to the "Issue Date" and populates the "Expire Date" field.
Hidden on the form is an unbound text box "txtFlagTime" which has the "=Now()" in the Default value field.
What i am looking to automate using VBA is that when the database is opened the VBA opens the form "frmUser_DS" and as the date updates in "txtFlagTime" the code updates the "UserSecurity" field with "INVALIDATED" if the date in the "txtFlagTime" field has exceeded the "ExpireDate" fields date.
This should be a hidden routine which runs on database opening to validate user expiry date and if their expiry date has passed their user security is set to INVALIDATED
I have code in the "Flag" field under On Got Focus which is:- If Me.Flag.Value = "Expired" Then Me.UserSecurity.Value = 4 4 is the Security ID which = "INVALIDATED"
This works if you click the field manually but i cannot get this to automatically update
Any ideas welcomed
Jonny