I am trying to display the results of this case and format the total amount in currency. However, It's not working and I am not quite sure why? Could someone please take a look at my code and tell me if you see what my eyes cannot. I just need a second pair of eyes on this one. Thank you!
Select Case ApplianceButton
Case "Refrigerator"
Label17.Text = FormatCurrency(kwVal).ToString
Case "TV"
Label19.Text = FormatCurrency(kwVal).ToString
Case "Fan"
Label21.Text = FormatCurrency(kwVal).ToString
Case "Space Heater"
Label23.Text = FormatCurrency(kwVal).ToString
Case "Oven"
Label25.Text = FormatCurrency(kwVal).ToString
Case "Dryer"
Label27.Text = FormatCurrency(kwVal).ToString
Case "Laundry Washer"
Label29.Text = FormatCurrency(kwVal).ToString
Label30.Text = Int((kwVal(Label17.Text) + kwVal(Label19.Text)
+ kwVal(Label21.Text) + kwVal(Label23.Text) + kwVal(Label25.Text)
+ kwVal(Label27.Text) + kwVal(Label29.Text)))
The
Appliancebutton
should be the value that should display or provide the name of your appliances, then than makesDim Appliancebutton as string
?then if you say that your Appliance button was clicked or in any kind of event that happened, then the value of
Appliancebutton=
should be either"Refrigerator" or "TV" or "Fan" etc...
to use
Formatcurrency
function, thenkwVal
should be an integer or double etc... right?and then on the grand total, the
kwVal(Label17.Text)
, seems like you are trying to multiplykwVal
and theLabel17.Text
...your symbol should be an asterisk * and you can't possibly multiply a string and an integer, then if it would help, use
Convert.toint32(label17.text)
, to complete the equation, though it may be long, I preferkwVal*(Convert.toint32(label17.text)
?Just making a guess... I don't know if this is right or helpful to you.