>>>I would like to do a simple (I hope) validation rule for a true-false field so that when the field is changed to false, the datetime is recorded.
>>>
>>>I thought it would be easy to set a validation rule for the logical field, but I'm missing something. Can anyone provide a simple example for me?
>>>
>>>TIA
>>
>>Simple expressions simply return .T. or .F.
>>
>>However, you might invoke a UDF - which can be stored in the database stored procedures - which does the replace. I am not sure, though, whether this might generate an "illegal recursion" if you do it from a field validation. IIRC, something like this regularly happens when you try to pull the same trick from a trigger.
>
>OK, so maybe I should do an 'insert into' another table to track the change?
>
>If I do that, since I'm only tracking one field, should I call a function from a field validation rule or from a table update trigger?
I would say, a trigger. I don't really trust field validation, or record validation, for that matter - they tend to fire too early. For example, a field validation: As soon as the user leaves the TextBox, the change will be recorded - and yet, the user might issue a TableRevert()!
Also, with triggers you can even track deletions. I don't think that can be done with record validation.
To record changes to another table, see my article "A basic audit-trail", Universal Thread Magazine, May 2003, Article #1476.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)