Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Display a grid field summary to a textbox in a form
Message
From
21/04/2000 07:15:21
 
 
To
21/04/2000 06:44:26
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00362166
Message ID:
00362169
Views:
28
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform