Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid Sum to textbox
Message
De
18/11/2000 16:09:03
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
18/11/2000 12:00:26
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00443370
Message ID:
00443398
Vues:
11
>Hi Gang,
>I have a grid on a form, that I'd like to display
>the sum of a field into a text box on the form
>but outside of the grid. This form has a two table
>ENV. Customer and product. The Customer is the parent
>table, and the product is the child table. The upper
>part of my form handles Customer information, the
>grid (child) displays the product information. What
>I'd like it to do, is display the sum amount of a price
>field into a textbox, and be able to refresh whenever
>I change or update a record.
>
>Can I get any help ?
>
>John

John,
IMHO best done with SQL sum. Normally you update or revert a child grid when you change parent, right (sometimes not-but assume right) ?
Scenario then goes on like this :
-SQL sum each time parent changes and place value in textbox
-Then in any field effecting total add gotfocus-lostfocus code that would just add the difference to textbox.value (textbox.value = textbox.value + (LostfocusValue-GotfocusValue))
This way you prevent performance degrade if you have many child records + you don't cause the rec pointer move that might cause side effects.
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform