QUOTE(KeyWiz @ 25 Nov, 2006 - 01:52 PM)

If you post a copy of the relevant code we may be able to assist you.
Ok, thanks. With the code below, the total is calculating fine, but the subtotal and tax display inaccurate amounts.
CODE
Private Sub btnCalculateTotal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculateTotal.Click
Dim decSubTotal As Decimal
Dim decTax As Decimal
'results in inaccurate total if enabled
'Calculate(decSubTotal, decTax)
'call to Sub DisplayOutput
DisplayOutput(decSubTotal, decTax, TotalPrice)
End Sub
CODE
Private Sub btnAddProduct_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddProduct.Click
'declare variables
Dim decSubTotal As Decimal
Dim strName As String 'selected product
Dim UnitTotal As Single 'number of products
Dim decTax As Decimal
'UnitTotal assignment
UnitTotal += CSng(Val(txtUnits.Text))
'call to Sub Calculate
Calculate(decSubTotal, decTax)
'Display product selection in listbox
strName = CStr(cboProducts.SelectedItem)
If strName = "" Then
MessageBox.Show("Please select an item", "No selection detected", _
MessageBoxButtons.OK, MessageBoxIcon.Error)
Else
Dim frmtStr As String = "{0, 44}" & ControlChars.Tab & "{1:N}"
lstDisplay.Items.Add(strName)
lstDisplay.Items.Add(String.Format(frmtStr, "Units:", UnitTotal))
End If
End Sub
CODE
Private Sub DisplayOutput(ByVal decSubTotal As Decimal, ByVal decTax As Decimal, _
ByVal TotalPrice As Decimal)
Calculate(decSubTotal, decTax)
Dim frmtStr As String = "{0, 44}" & ControlChars.Tab & "{1:N}"
lstDisplay.Items.Add( _
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
lstDisplay.Items.Add(String.Format(frmtStr, "Subtotal:", FormatCurrency(decSubTotal)))
lstDisplay.Items.Add(String.Format(frmtStr, "Tax:", FormatCurrency(decTax)))
lstDisplay.Items.Add(String.Format(frmtStr, "Total:", FormatCurrency(TotalPrice)))
End Sub
CODE
Sub Calculate(ByRef decSubTotal As Decimal, ByRef decTax As Decimal)
Dim decProductPrice As Decimal
'declare constants
Const TAX As Single = 0.089
'UnitTotal assignment
UnitTotal += CSng(Val(txtUnits.Text))
'price of product assignment, selected
decProductPrice = (priceArray(cboProducts.SelectedIndex))
'subtotal
decSubTotal = CDec(decProductPrice * UnitTotal)
'tax
decTax = CDec(decSubTotal * TAX)
'total price
TotalPrice = (decSubTotal + decTax)
End Sub