Visual Basic

Moderators: None (Apply to moderate this forum)
Number of threads: 18011
Number of posts: 55384

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Multiplying a value by item selected in a combobox? Posted by CookieMonster on 29 Mar 2011 at 11:39 AM
Would it be possible for someone to help explain how to multiply a value i.e. the price of a product by an item selected in a combobox e.g. quantity required and display the results in a list box. I have in total 15 checkboxes which each have been assigned a price using a price array but I am unsure as to what to do next. Any guidance would be much appreciated.
Report
Re: Multiplying a value by item selected in a combobox? Posted by pseudocoder on 29 Mar 2011 at 12:47 PM
I have a bad habit of misreading questions at times, but if I've read it correctly, you have a fixed cost, a combo box with quanity, and want to add the result to a listbox?

VB 6 is all I have, so I dunno about other versions. In the combo's click event, you might try something like

List1.addItem Format(CStr(cost_of_item * CSng(Combo1.List(Combo1.ListIndex))), "####.#0")


Try that and see if it does what you need.
HTH
Report
Re: Multiplying a value by item selected in a combobox? Posted by reyborn on 30 Mar 2011 at 12:36 AM
Please post your existing code so that we can give you idea on how to solve it.




 

Recent Jobs