Hi Sylvia, I'm not fully certain if this matters or not, but I always do it when doing a sum, selecting the table you are doing the sum on (activity file) that is. There's no need to save the record pointer for the employee table, but you'll probably need it for the activity file, or just go to the top if you have a relation set up, selecting the parent table will take care of it.
so basically the AfterRowColChange event code would look something like this:
sele activity
calculate sum(activity.hours) to thisform._textbox1.value for ;
activity.employeeno=gcSeekVal
go top
sele employee
ThisForm.Refresh()
I usually put this in a method because I don't like to put much code in a control, only method/prg calls.
HTH
>I have a form with two grids, grid1- parent employee file,
>grid2- child activity file.
>
>I have a textbox to hold the sum of activity.hours, but it seems to just display the final record value, not the sum. Here's the code I have in RowChange of Grid1:
>
>gcSeekVal = employeeno
>calculate sum(activity.hours) to thisform._textbox1.value for activity.employeeno=gcSeekVal
>seek gcSeekVal &&this is just to keep pointer on employee clicked
>
>What obvious thing have I missed. (Tick, tick, tick, Y2K clock)
>
>Thanks in Advance,
>Sylvia