i actually figured that out... I have a new problem..... I need to be
able to include many items in an order. i know this is probably a
simple thing but I know im in the right track but I keep getting a
convertion to from string to double is not valid. keep in mind this is
different button then the one above. i put "<<<<<" in a comment area
for the line of code i'm talking about. SO in other words I want to be
able to add 2 for quantity then after the item total is set add 4 more
for quantity then have it added and displayed in txtsubtot.text. If
you get what I'm saying....?


   Private Sub btnCalcItem_Click_1(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles btnCalcItem.Click

        Dim quantity As Integer
        Dim item_total As Double
        Dim unit_price As Double
        Dim sub_total As Double
        Dim tax_rate As Double
        Dim total_price As Double
        'Dim add_orders As Double

        If IsNumeric(txtquantity.Text & txtUnitPrice.Text) Then

            quantity = CInt(txtquantity.Text)   'convert user input
for quantity into an integer
            unit_price = CDbl(FormatNumber(txtUnitPrice.Text, 2)) '
convert user input for price to a double
            item_total = quantity * unit_price 'quantity * unit_price
is set in item_total
            txtItemTotal.Text = CStr(FormatCurrency(item_total))
'display item total in textbox

            sub_total = item_total + CDbl(txtSubTot.Text) ' >>here>>>i
want to add the data in the txtsubtot.text to the item_total and put
it in my VAR sub_total
            txtSubTot.Text = FormatCurrency(sub_total) 'displays users
total in sub_total textbox


            tax_rate = CDbl(txtSubTot.Text) * tax 'user item * tax is
stored in tax_rate_total
            txtTax.Text = CStr(FormatCurrency(tax_rate)) 'format
textbox and store in textbox

            total_price = tax_rate + item_total 'tax rate + item total
and store in total price
            txtTotal.Text = CStr(FormatCurrency(total_price)) 'format
textbox and store in textbox

        Else
            MsgBox("Invaild Character")
        End If
    End Sub

Reply via email to