Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP 5.0 - Grid - Running Balance
Message
From
03/01/1997 14:35:24
 
 
To
03/01/1997 14:25:43
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00016391
Message ID:
00016416
Views:
48
>thisform.calc_bal code (maybe this is the part where I am messing up)
>-----------------------------------
>thisform.n_run_bal = thisform.n_run_bal + history.amount
>return thisform.n_run_bal
>
>I created a property for the form to hold the running balance: thisform.n_run_bal

Ok, I know what you meant in the first place where the value was being incremented.

The problem is that the grid is calling the method not only one time per record but each time it is being accessed.

I would suggest doing a COUNT SUM(yourfield) FOR recordbeforeorequalthecurrentone TO lnBalance.

Make sure you have a tag on the condition.

Another method will be to add an additional field in your table and avoid the calculation at run time.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Reply
Map
View

Click here to load this message in the networking platform