Hi Chiang,
Write a custom method which receives field name as parmeter and returns total of a column. In this method use
For Example
*-- Method GetSum
LPARAMETER tcfield
LOCAL lcalias
LOCAL ARRAY lasum[1]
lcalias = Thisform.grditem.recordsource
SELECT SUM(tcfield);
FROM &lcalias;
INTO ARRAY lasum
RETURN lasum[1]
Hope will help
Bye
Jayesh
>I have set up a one-to-many form with the grid showing invoice line items.....it there an easier way to total a column in the grid rather than going through all that as described in the TASTRADE sample that came with VFP 5.0
>
>I tried using the SUM command but is doesn't work.
>
>Can someone direct me to the easiest method in doing so?
>
>Thank you
>
>Rgds,
>Jeff Chiang
- Jayesh