Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Total a grid column
Message
De
17/11/1999 15:10:00
Jorge Haro
Independent Consultant
Juarez, Mexique
 
 
À
17/11/1999 12:30:11
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00291973
Message ID:
00292081
Vues:
21
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 && or whatever the name of the employee file is

ThisForm.Refresh() && Or maybe just the textbox
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform