Link to home
Start Free TrialLog in
Avatar of versello
versello

asked on

Removing ListBox item, subtracting value

I would like to thank all those who helped me out earlier, but I have another question for those who don't mind... I have a Combo Box on my form with various data items with price values.  When the user clicks on the combo box, a drop down list pops up, and they select their product.  The price value is then added to the lblTotal (running total) and added to lstSelected (the list that holds everything they selected).  However, how do I have an item removed if they choose to change their mind and choose another option from the combo box AND have the lblTotal subtract the amount given earlier?  
  I've been knocking my head earlier on this one.  Thanks
Avatar of versello
versello

ASKER

Adjusted points to 61
ASKER CERTIFIED SOLUTION
Avatar of eab111098
eab111098

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I was hoping that it would be done automatically... if you know how, I would really appreciate it, but otherwise, this will do as well... Thanks
if they choose another item and you want the last item added to the lstselected listbox, then you simply record the index to where the item was added.

with the index recorded, you simply put my previous code in some function and call it when the user clicks an item in combo box. in the function that you will build from the above code, you would need to simply change the lstSelected.listindex to the index variable that is storing the index value of the item you just added.

ed.