Calculation
to Stamp Date and User ID when Check Box is Marked
The
following expression, used in a calculated field, will stamp that
field with the current date and user ID whenever the check box
field 'contact2.checkfield' is marked. It will also remove the
stamp when the check box is unmarked. Because of the iif() statement,
the field will not be changed whenever the record is edited, only
when the check box is marked or unmarked:
iif(contact2.checkfield
and empty
(contact2.charfield),dtoc(date())+' '+
cuserid,iif(!contact2.checkfield and !empty
(contact2.charfield),space(12),contact2.charfield))
The field 'contact2.charfield' used in this example is a character
field with a length of 12. The field needs to be long enough to
contain whatever will be automatically placed in it by the calculation,
and the number (12) in the last line of the expression must match
the actual length of the field.
--
End of FAQ #501