Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Display a grid field summary to a textbox in a form
Message
De
21/04/2000 07:15:21
 
 
À
21/04/2000 06:44:26
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00362166
Message ID:
00362169
Vues:
27
Hi John.

>> I have a form that has both text box's and a grid, I'd like to display
a filed in the grid as a summ in a text box. I'll be pointing to a record and linking to another displaed in a grid. I'd like to summ one
of the field in the grid to a text box on the form. <<

You mean you want to display the sum of the number in a single grid column in a text box on the form? If so, You could create a Custom form Method called DisplaySum and call it from the Valid method of the textbox in the grid along with the column's controlsource as a parameter:

Call like this:

Thisform.DisplaySum( This.ControlSource )

In the DisplaySum method:

LPARAMETERS tcControlSource
LOCAL lnCurRec
*** Save the current record number because the SUM command moves the record pointer
lnCurRec = RECNO( JUSTSTEM( tcControlSource ) )
SUM EVAL( This.ControlSource )FOR SomeCondition TO lnSum
This.Parent.Parent.Parent.txtColumnSum.Value = lnSum
GO lnCurRec IN ( JUSTSTEM( tcControlSource ) )

Please note that I have not tested this and it is pretty much off the top of my head. But hopefully, it is enough to get you started.

Marcia
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform