4 Replies - 2175 Views - Last Post: 14 October 2011 - 03:19 PM Rate Topic: -----

#1 savgre25   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 14-October 11

adding number in a listbox then multiplying by a number using one btn

Posted 14 October 2011 - 02:49 PM

so what I'm needing help on is adding all the numbers in a list box then multiplying it by a %.
theres one listbox and two buttons, and two textboxes.i've completed everything but this and can't fibd it in my book. I just looking for pointers. this is what i have which i know isn't right

Dim sum, cost As Double
sum =
cost = sum * 0.06
lstbox.Items.Clear()
lstbox.Items.Add("Total Commission =" & cost & ".")

Is This A Good Question/Topic? 0
  • +

Replies To: adding number in a listbox then multiplying by a number using one btn

#2 DimitriV   User is offline

  • vexing conundrum
  • member icon

Reputation: 587
  • View blog
  • Posts: 2,746
  • Joined: 24-July 11

Re: adding number in a listbox then multiplying by a number using one btn

Posted 14 October 2011 - 02:56 PM

Well first, welcome to DIC.
Second you haven't given the Double 'sum' a value, so cost will return 0.
J-Bo
Was This Post Helpful? 0
  • +
  • -

#3 DimitriV   User is offline

  • vexing conundrum
  • member icon

Reputation: 587
  • View blog
  • Posts: 2,746
  • Joined: 24-July 11

Re: adding number in a listbox then multiplying by a number using one btn

Posted 14 October 2011 - 03:04 PM

Oh, and also please post between code tags.
I understand youre new, but it's best to know.
if you need any help, we're here.
J-Bo
Was This Post Helpful? 0
  • +
  • -

#4 savgre25   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 14-October 11

Re: adding number in a listbox then multiplying by a number using one btn

Posted 14 October 2011 - 03:13 PM

thank you, I just need some advice stuck on this exercise and my book is no help at all
Was This Post Helpful? 0
  • +
  • -

#5 DimitriV   User is offline

  • vexing conundrum
  • member icon

Reputation: 587
  • View blog
  • Posts: 2,746
  • Joined: 24-July 11

Re: adding number in a listbox then multiplying by a number using one btn

Posted 14 October 2011 - 03:19 PM

Hlad i could help.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1