Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Invoice Grid Recalculates Erroneous Sub-Totals
Message
De
26/05/2002 20:59:35
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
26/05/2002 15:29:00
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00661499
Message ID:
00661542
Vues:
19
>Hi Everyone,
>
>I am having trouble with a VFP grid that I use in my app. for invoicing. Everything works perfect when I add new items. The quantity and price columns are related by a multiply operation giving the right sub-total for that row. This equation is used in the "Lost Focus" method of each control. However if for example I am standing on item 2 row and click to change quantity (for example) for item 1, the subtotal for row 1 is calculated by the new quantity x the price of item 2. Why does this happen ?
>
>Now if I jump to price of item 1 and then loose focus of the control, the correct amount is displayed for sub-total.
>
>How can I fix this situation ?

Do your calculations in the grid's BeforeRowColumnChange or AfterRCC methods. When your code fires from a lostfocus, you're not quite sure as to which record is the recordsource of your controls. During the BRCC you're still sitting on the same row - and I'd actually recommend to try to use fields (i.e. replace command), not control.value. YMMV, of course, but I'm generally more comfortable dealing with fields than grid controls.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform