Automatically inputing a time with the update of a field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to have a time field which will automatically take the value of
the time another field on the same form was updated. For example, if I
update the field ClientName at 12:15 PM I would like this to be the permanent
value in the time field. How can I do this? Thanks.
 
eileenjess said:
I would like to have a time field which will automatically take the value of
the time another field on the same form was updated. For example, if I
update the field ClientName at 12:15 PM I would like this to be the permanent
value in the time field. How can I do this? Thanks.

If you want this to occur for ANY field that gets updated and only for the
first time (ie when the TimeStamp field is empty), then this code will go in
the AfterUpdate event for the form.

if not isnull(me![YourTimeFieldHere]) then
me![YourTimeFieldHere] = Now
endif

If you wanted this to occur only when the ClientName field is updated, then
you'd use that code in the AfterUpdate event for the ClientName field.

Hope that helped.
Dave
 
Back
Top