Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to sum a column on a grid?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00449977
Message ID:
00449997
Vues:
17
>I am working on a parent-child form. The children records are displayed on the >grid. The 3rd column of this grid is the item costs and I have to total this >column. I would like to display the total cost on the form(but not on the grid)>and add total to a field in parent table. Have tried this code without >results. can you help ?

Depending on when you want the calculation to occur you can use CALCULATE SUM() on the cost column and place the result where ever you want. I would create a custom method on your form that does just that, then call the method whenever you need to. For example: whenever you add a record to your item list, assuming this is an invoice or PO of some kind.

This way the task of totaling the item list is "wrapped" into a single method call.

HTH
Eric Kleeman - EDS Consulting Services
MCP Visual FoxPro
MCSD C#.NET
Hua Hin Thailand
Los Angeles California
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform