Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Loop in GRID when AfterRowColChange
Message
From
25/01/2007 15:49:42
 
 
To
25/01/2007 15:38:38
Luis Santos
Biglevel-Soluções Informáticas, Lda
Portugal
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
MS SQL Server
Miscellaneous
Thread ID:
01187615
Message ID:
01189380
Views:
21
>Hello Edward
>
>Many thanks for your useful help.
>on my reply i forgot to ask you if in your code i can place where you have write:
>.RemoveObject(oColumn.name)
>
>"on lostfocus" or after changing "Afterrowcolumnchange" value of this column, some code for make for example a calculation in another column automatically.
>for example :
>1 column have % value - 21%
>2 one column - total of value
>3 another one = amount = total value * 21%
>i want when a change 21% to 10% then total value is automatically recalculate, or, if i write on the column of Totalvalue then recalculate the percent value %
>
>I hoop my question don´t make a little confused, but in this moment this is what i need to do , and on my first code i loop all the time.
>
>Best regards Edward
>
>Luis Santos

First of all, the code that you posted, and that I improved a bit, was just to remove a column, and realistically you could put in the place where you want to remove a column, e.g. in Form.Init (?), sorry I'm totally unfamiliar with your application.
In regard to your current questions: basically, you don't need in much coding to do it. You should put formulas in column.controlsource. For example, if column1.controlsource='mytable.amount', and you want to show 21% of this value in another column, then column2.controlsource='0+mytable.amount*21/100'.
If 21% is another field value, then column2.controlsource='0+mytable.amount*mytable.percent/100' etc.
You may multiple, add, subtract, do any kind of calculations within controlsource.
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform