Helpfulbox Now Offers Free POS Software for restaurants, kiosk, and any other retails business completely free used windows cashier system or as full blown POS. You will able to print to kitchen, display orders on the kitchen screen, manage inventory, employee, report, customer loyalty offers, employee management, delivery address track and much more, al for free.

Visual Basic Currency Listbox Sum I'm trying to add the sum of a listbox with prices formatted as Currency. When I go to sum the sngTotal of the listbox I get $0 for my sum. I've tried declaring the sum as Currency and Single variables but it only seems to work when I don't format the listbox without currency. I need the listbox to keep currency values displayed. Here's code: Dim sngTotal As Single Dim intCounter As Integer For intCounter = 0 To lstExtPrice.ListCount sngTotal = sngTotal + Val(lstExtPrice.List(intCounter)) Next lblTotal.Caption = Format(sngTotal, "Currency")

By: Guest
Date: Unknown--
Response
0
VB is more than just letters

Can I see your entire code, plus a screenshot of your UI? I can't tell entirely what all of your variables are (though nice Hungarian notation -- props!)

[d] By: Guest
Date: unknown---
Response
0
No UI

Not sure if I can upload UI. I have a listbox that has currency values in it.

Private Sub ComputeTotal()

Dim sngTotal As Single

Dim intCounter As Integer

For intCounter = 0 To lstExtPrice.ListCount

sngTotal = sngTotal + Val(lstExtPrice.List(intCounter))

Next

lblTotal.Caption = Format(sngTotal, "Currency")

End Sub

[d] By: Guest
Date: unknown---
Response
0
Visual Basic what?

.NET? 6?

I see in another post you have "currency values". It's very possible that you're trying to append a list of literal strings to a single...

have you walked through the loop in debug to make sure that val(lstExtPrice.List(intCounter)) contains what you think it contains?

[d] By: Guest
Date: unknown---
Response
What is 1 + 100



Helpfulbox Now Offers Free POS Software

for restaurants, kiosk, and any other retails business completely free. It can be used as windows cashier system or as full blown POS. You will able to print to kitchen, display orders on the kitchen screen, manage inventory, employee, report, customer loyalty offers, employee management, delivery address track and much more, all for free.

Just Updated::