Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to put running balance in local view?
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00212879
Message ID:
00213116
Views:
32
>I have a local view of account detail items which I use with a codebook/VFE app. I have a child grid based on the view which works well. The user can scroll up and down to see all of the items (or just the open items) on the account.
>
>Now I would like to add a running balance to the view.
>
>So far I've added a dummy field to the view: 000000.00 as yBalance. After I populate the view, I run a scan loop to calculate the balance and plug it in to the yBalance field. This works fine from the command prompt. BTW, I found out that if I defined the field as "0.00" it would not contain more than 3 digits.
>
>But now when I use the grid in my form I get the message "cannot update the cursor." I get this not only on the REPLACE statement within the scan loop but on the REQUERY() statement before the scan loop.
>
>Any one have suggestions on the right way to do this?
>
>Peter Robinson

Here is my local view:
open data ves
CREATE SQL VIEW "LV_BAL_TEST" ;
AS SELECT Armast01.invno, Armast01.invdte, ;
Armast01.custno, Armast01.invamt, 00000000.00 as bal ;
FROM f:\pro30\ardata\armast01 ;
WHERE Armast01.custno = ?vp_custno

in active page

vp_custno = v_cust.custno
sele v_bal_test
requery()

sum invamt to post_amt
pre_amt = v_cust.balance - post_amt
go top
scan
repl bal with pre_amt + invamt
pre_amt = pre_amt + invamt
endscan

Then go to the object list and get the string for your grid, then add the .refresh() to show the user the work is done.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform