Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Field validation rule
Message
From
20/01/2010 11:38:01
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01444944
Message ID:
01444995
Views:
27
>>Al,
>>
>>You can change the contents of a field in the table's validation rule - regardless of whether the record was changed in a browse window or not
>>The table rule will not run recursively
>>
>>
>>Code
>>
>>&& somewhere in the record validation rule
>>
>>if( FieldChanged('TheNameOfTheField') )
>>    replace TheNameOfTheField with YourChangedContents
>>endif
>>*--------------------------------------------------------------------------
>>function FieldChanged(FieldName)
>>
>>	do case
>>	case isnull(oldval(m.FieldName)) or Isnull(eval(m.FieldName))
>>		return (isnull(oldval(m.FieldName)) <> Isnull(eval(m.FieldName)) )
>>	otherwise
>>		return (oldval(m.FieldName) <> eval(m.FieldName))
>>	endcase
>>endfunc
>>*-------------------------------------------------------------------------
>>
>
>It would not work until you move out of the record (or commit changes).

I know that
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform