Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need assistance with 'field validation'
Message
De
28/02/2003 14:18:21
 
 
À
28/02/2003 14:13:44
Mike Sue-Ping
Cambridge, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00759567
Message ID:
00759570
Vues:
19
>Hi All,
>
>I'm stuck on this very basic (at least I think it is) VFP database design issue.
>
>I've got a table with three fields, LENGTH, WIDTH and AREA. I'd like to have the AREA field automagically update its value with the product of LENGTH and WIDTH whenever either of those two values change.
>
>This update must occur under the following circumstances:
>
>1) the table is browsed to make edits to the LENGTH and/or WIDTH columns.
>2) the table is appended to.
>3) the LENGTH and/or WIDTH is modified on a form containing controls bound to them.
>
>I believe that I need to do something in the database container to "trigger" this but where and how?
>
>TIA.
>
>Mike

Mike,

Put the code in the Record Validation rule
do case
case area <> Length * Width
  repl  area with Length * Width
endcase
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform