Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to sum a column of a grid control
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00638188
Message ID:
00638263
Vues:
23
Hang,

Make your life easier and forget that the grid is ther instead work with the rowsource of the grid. In the textbox's refresh event put this code;
LOCAL lnRecno, lcAlias
lcAlias = ALIAS()
SELECT (Thisform.Grid.RowSource)
lnRecno = RECNO()
SUM TheFieldYouWant TO This.Value
IF lnRecNo < RECCOUNT()
   GOTO lnRecNo
ELSE
   GO BOTTOM
   SKIP
ENDIF
IF EMPTY(lcAlias)
   SELECT 0
ELSE
   SELECT (lcAlias)
ENDIF
Now whenever the data in the grid changes you can;
Thisform.Textbox.Refresh()
and get the total displayed.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform