Locking a field after a certain amount of time.

tucker61

Registered User.
Local time
Today, 07:56
Joined
Jan 13, 2008
Messages
344
I have a comments field that becomes disabled after a Afterupdate event.

Sometimes users need to go back into the same comments field, so i would like to allow them 1 hour (or something similar) to go back into the same comments field and amend the detail.

Code is similar to the below.

I have a DATE / TIME (tbnow) field that is populated as soon as they start entering comments. As =NOW()..

So can I add to the below code "AND Tbnow > now() -60" or similar ?


If Len(Me.[Assigned Date] & "") > 0 Then

Me.[Assigned Date].Enabled = False

Me.[Assigned Date].Locked = True

Else

Me.[Assigned Date].Enabled = True

Me.[Assigned Date].Locked = False

End If

Sent from my SM-T715 using Tapatalk
 
If I was one of your users, I would feel very unhappy about having to wait an hour to edit a comment.

By all means, lock the field if you must... but suggest you then make a button visible that when clicked reverses the action to allow editing

And if you choose to go ahead with this, it's more complicated than using 60 as you suggested.
Access stores dates and times as double numbers where each full day = 1
This means 1 hour =1/24
 
Sure, use DateAdd() to add/subtract the desired time period. Not sure what event you're thinking about. If the field is disabled and locked, I don't think the user can click in it to unlock.
 
If I was one of your users, I would feel very unhappy about having to wait an hour to edit a comment.

I'm the slow typist today, but I think you've reversed the above. ;)
 
If I was one of your users, I would feel very unhappy about having to wait an hour to edit a comment.

By all means, lock the field if you must... but suggest you then make a button visible that when clicked reverses the action to allow editing

And if you choose to go ahead with this, it's more complicated than using 60 as you suggested.
Access stores dates and times as double numbers where each full day = 1
This means 1 hour =1/24
Currently it locks the comments field on the after update event. What I want to do Is give them some additional time before it locks, so they can check spelling etc, so they don't need to add a additional comments field.

Sent from my SM-T715 using Tapatalk
 

Users who are viewing this thread

Back
Top Bottom