Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Field validation rule
Message
De
20/01/2010 11:38:01
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01444944
Message ID:
01444995
Vues:
26
>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform