General information
Category:
Forms & Form designer
Title:
Calculate total values when check column on grid is true
Environment versions
Network:
Windows 2003 Server
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only