Nope this dont work. It still allows me to change it. When I make a change to existing data it goes into debugger mode.
Let explain what i have in this field...I have a filed to record date of inputting a record. The user enters the date on creating this record. I've managed to allow the field to accept only the Current Date, which work fine.
Now i would like to protect it after input, so it cannot be ammened later by anyone else.
Private Sub MyField_AfterUpdate()
Me.MyField.Locked = True
End Sub
What I do is let the user finish the form and then at the end they have to press the SAVE button or something. Behind the save button couple of things are updated:
1. Saved checkbox - hidden
2. Last Modified by with date and time - etc.
So on the current form and load event property of the form the following happens:
if me.saved.value = true then
me.field1.locked = true
else
me.field1.locked = false
end if
You don't have to have a saved checkbox. You can reference any field that can be checked against.
My Bad. Didn't read all the info on the second posting by the user. Yes your solution would work just fine except I would make the default property locked so the date is not grayed out. Just a personal preference here. Adjust according to your taste buds.
With my long winded solution you are able to lock more than one field after the record has been "saved".
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.