Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Total a grid column
Message
 
À
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:
00292020
Vues:
44
>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

Silvia, I usually use the functions like this one for getting the sums:

FUNCTION sum_activity_hours
LPARAMETER lcEmployeeno
LOCAL laSum[1]
store 0 to laSum[1]
SELECT SUM(activity.hours) FROM activity ;
WHERE activity.employeeno = lcEmployeeno ;
INTO array laSum
RETURN laSum[1]
ENDFUNC

HTH,

Nick
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform