Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to sum a column on a grid?
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00449977
Message ID:
00449997
Views:
16
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform