Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to put running balance in local view?
Message
 
À
28/04/1999 13:29:27
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00212879
Message ID:
00213124
Vues:
35
I usually do not setup the view for it - I put the code like this into textbox.Refresh()

LOCAL array laTotal[1]
laTotal[1] = 0
SELECT SUM(amount) FROM myView as Total
INTO array laTotal
this.value = laTotal[1]

Just my 0.02c CDN :)

Nick

>Hi Peter ---
>
>There is a really simple way of doing it. Create a view that queries your view; ie, CREATE VIEW subtot AS SELECT SUM(amount) AS subtot FROM myview. Then bind a disabled or read-only textbox to subtot.subtot and REQUERY() subtot and subtot-bound control refresh() whereever the original view can be modified.
>
>
>
>
>>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
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform