Locking a field after a certain amount of time. (1 Viewer)

tucker61

Registered User.
Local time
Today, 15:48
Joined
Jan 13, 2008
Messages
321
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
 

isladogs

MVP / VIP
Local time
Today, 23:48
Joined
Jan 14, 2017
Messages
18,209
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
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 15:48
Joined
Aug 30, 2003
Messages
36,123
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.
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 15:48
Joined
Aug 30, 2003
Messages
36,123
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. ;)
 

tucker61

Registered User.
Local time
Today, 15:48
Joined
Jan 13, 2008
Messages
321
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

Top Bottom