Information générale
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Calculate total values when check column on grid is true
Versions des environnements
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
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement