Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can anybody help a newbie? II
Message
 
To
05/10/1999 17:50:35
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00272960
Message ID:
00272965
Views:
22
>that would probably work if i could set up my variables correctly.
>where would i declare 'combo1+combo2+....+comboN = TheComboSums'
>combo1 is the NAME of my 1st combo box?
>
>thanks again!
>JD

Jimmy,

If you reply to messages thenthe conversation will remina in one thread and others can follow and help better. The Reply option is at the bottom of the message frame, just click it and type your reply.

As for your answer, if you have up to n combos thent eh best way to handle this problem is through delegation to the form. If you try to do this in each combo then every combo will need to know about every other combo and that could cause you problems if you ever remove or add a combo in the future.

To your form (using the fomr-New Method menu option) create a method named UpdateTextBox. In that method put this code (or similar if your names are different).
* Form's UpdatetextBox method
LOCAL lnTotal
WITH THISFORM
   lnTotal = VAL(.Combo1.List(.Combo1.ListIndex)) + ;
             VAL(.Combo2.List(.Combo2.ListIndex)) + ;
             VAL(.Combo3.List(.Combo3.ListIndex)) + ;
             VAL(.Combo4.List(.Combo4.ListIndex)) + ;
             VAL(.Combo5.List(.Combo5.ListIndex))
    * Add for all of the combos
    .Text1.Value = lnTotal
    .Text1.Refresh()
ENDWITH
Then in the InteractiveChange event of each combo put;

Thisform.UpdateTextbox()
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform