Information générale
Catégorie:
Codage, syntaxe et commandes
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement