Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calculate total values when check column on grid is true
Message
From
31/07/2007 14:37:29
Luis Santos
Biglevel-Soluções Informáticas, Lda
Portugal
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Calculate total values when check column on grid is true
Environment versions
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01244964
Message ID:
01244964
Views:
67
Hello comunity

I have a form based on tsql cursor. On my grid , i have a column to check (TRUE/FALSE)
and on this column i have the following code.

LOCAL lctotal as Double
lctotal = 0
SELECT CCHEQUES ->(is my Cursor)
DO CASE
case thisform.grid1.column1.check1.Value = 1
thisform.grid1.column5.Text1.Value = THISFORM.Cmb1EMP.Value
thisform.grid1.column7.Text1.Value = THISFORM.Cmb2DO.Value
SELECT ccheques
IF thisform.grid1.column1.check1.Value = 1
lctotal = lctotal + thisform.grid1.column6.Text1.Value
endif
otherwise
thisform.grid1.column5.Text1.Value = " "
thisform.grid1.column7.Text1.Value = " "
ENDCASE
thisform.total.Value = lctotal
thisform.grid1.Refresh

SELECT ccheques
if thisform.grid1.column1.check1.Value = 1
lctotal=lctotal + ccheques.valor
endif
thisform.total.Value = lctotal
thisform.grid1.Refresh

this code is on procedure "Interactivechange" and "LostFocus" but simply my textbox TOTAL show mw only the value of first row and don´t make a SUM of (thisform.grid1.column6.Text1.Value).
Could someone give me an ideia or a simple example.

Many thanks
Luis Santos
Next
Reply
Map
View

Click here to load this message in the networking platform