Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem in GRID with calculate column
Message
De
02/02/2007 08:52:30
 
 
À
01/02/2007 18:07:35
Luis Santos
Biglevel-Soluções Informáticas, Lda
Portugal
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01190586
Message ID:
01191738
Vues:
18
>Hello again Edward
>
>unfortunatly, i can put my grid work properly and i will again your help.
>I am go to try to explain better what i want:
>my GRID design
>
>-------------------------------------------------------------------------------------
>article gross weight(a) %moistness(b) valueofmoistness(c) quantity(d)
>-------------------------------------------------------------------------------------
>1 12000,00 5 600,00 11400,00
>
>
>Controlsource of each field on my invoive line table FI
>Gross weight : table field FI.u_nospeso
>%moistness : table field FI.U_HUM
>valueofmoistness : table field FI.U_VALHUM
>quantity : table field FI.QTT
>
>EVENT i have available in this program : AFTERROCOLCHANGE
>
>i pretend when i insert 5% on %moistness(FI.U_HUM) the column field valueofmoistness(FI.U_VALHUM) is calculate automatically : gross weight * 5/100 then Quantity is 12000-600=11400
>this following code do that :
>
>STORE "" TO clname
>STORE " " TO PERNAME
>FOR EACH myform IN _Screen.forms
>IF UPPER(myform.name)="SFT"
>WITH myform.Pageframe1.Page1.Cont1.Grid1
>FOR i=1 TO .columnCount
>IF UPPER(.Columns(i).ControlSource)="FI.U_VALHUM"
> clname=.Columns(i).name
> .columns(i).text1.lostfocus()
> .Columns(i).text1.value = ((fi.u_nospeso)*fi.u_hum)/100
>exit
>ENDIF
>NEXT i
>EXIT
>ENDWITH
>ENDIF
>NEXT myform
>
>But also i want when i change the value of the column valueofmoistness(FI.U_VALHUM), automatically the column field %moistness(FI.U_HUM) is recalculate.
>I try many things without sucess. I feel that if i don´t know on what column index number or activecell i have the focus when this column loose the focus the software don´t know what column it must bring up to date.
>
>In fact , in this moment is my BIG problem because only with this code i can´t do that.
>
>Really, i don´t know how can do this and i hope sincerely that you have a great ideia to resolve this problem.
>
>I expect as soon has possible your advise

I feel we should go step by step. By the way, I don't think that allotting a day for each step is the most efficient way.
Firstly, erase your code (and don't touch AFTERROWCOLCHANGE, please). Secondly, tell me now what is your grid.recordsource
Thirdly, give meaningful names to grid.columns, e.g. colMoistness,colQuanity etc. Please, post the names when it's done.
Edward Pikman
Independent Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform