That is wrong BeforeUpdate event. Use the form's event as suggested in post 23, not the textbox. Makes no sense to use the textbox event because user is not supposed to edit it. Set it as Locked Yes and TabStop No.

If you don't want the value changed when existing record is revisted and edited:



If IsNull(Me!TimeOfLeaving) Then Me!TimeOfLeaving = Now()

These two controls don't even have to be visible to the user. In fact, don't even need textboxes at all. The DefaultValue property can be set for the field in table design. The suggested code is actually populating the field directly, not textbox.