Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid Question...
Message
From
23/08/1999 10:23:09
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
23/08/1999 10:14:12
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00256561
Message ID:
00256566
Views:
24
>I'm taking a look at a poject a fried of mine is working on in which he has a grid that he performs line by line calculations in. The calculations are done during a lost focus in one of the columns that updates another column further to the right of the active cell. The issue that is coming up is that when there are more than one row and he arrows from left to right and then down arrows to the next line, the calculations are firing with a value from the previous row instead of the active row. For Example:
>
>Qty Price Total
>1 1.00 1.00
>2 2.00 4.00
>
>When you arrow through the grid (up/down/left/right, etc.) He gets the following occring if he arrows left to right from qty after arrowing through line 1:
>
>Qty Price Total
>1 1.00 1.00
>2 2.00 2.00
>
>The calculation is in the lost focus of Qty and references the price columns value to calculate the total.
>
>The only way this actually works is to arrow through the entire line to get the correct total. It seems as though the Column reference is only updating when it has been the active cell.
>
>Now the question of the day <g>...how do you reference a columns value of the active row if you haven't made it an active cell prior to the calculations?
>
>Does any of this make any sense that I have written. A little confusing to me as well. <g>
>
>Thanks for any assistance.

I use directly field names (activerow is not thrustable here because in lostfocus it's 0). Why not simply set controlsource to Qty*Price and remove lostfocus code ?
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform