View Single Post
Old Nov 24th, 2006, 7:37 PM   #1
dwizzle13
Newbie
 
Join Date: Oct 2006
Posts: 19
Rep Power: 0 dwizzle13 is on a distinguished road
Format Exception Error

Hi, I have a format exception error when I try and calculate the price of a product and service in a program using menu bars in vb. I'm not sure what's wrong except there's an error with index(zero-based) not being the correct size. Here's the small portion of the code (the error is in a portions like this.)
 If rad2.Checked = True Then
            If radF.Checked = True Then
                total = 12.0
                'add deposit and display
                Deposit = 30.0
                total = total + Deposit
                total = FormatCurrency(total, 2)
                lstOutput.Items.Add(String.Format(fmtTable, "Lawn mower  ", FormatCurrency(12.0, 2), "(Full-day rental)"))
                lstOutput.Items.Add(String.Format(fmtTable, "Deposit", FormatCurrency(Deposit, 2)))
                lstOutput.Items.Add("----------------")
                lstOutput.Items.Add(String.Format(fmtTable, "Total", FormatCurrency(total, 2)))
            End If

Just please tell me what to do to correct it, I only know up to menubars and select case, it's for my comp. science class. Thanks.
dwizzle13 is offline   Reply With Quote