hi all,
i am am working on a tax software that computes tax and gives the amount.since different goods have different tax percentages i would like when one customer buys goods with different tax percentage i can use the subtotal button to temporarily hold the tax value as he computes another and eventually when he presses the total button he gets the sum total of all the taxes.please share any ideas.

7 Years
Discussion Span
Last Post by jhai_salvador

thanks Abu, i tried that option with the code below.yes i can hold the values bt how do i add them to obtain a total?

Private Sub Command1_Click()

If Text1.Text = "" Then
MsgBox "", vbInformation

Label1 = Label1.Caption & vbCr & (Text1.Text * 0.16) & "#" & Text1.Text & Space(2) & "A"

'Text1.Visible = False
'Label1.Visible = True
End If

End Sub

where A is the tax code e.g 16%

Edited by maichy: n/a


You can use variables to hold each value you need. You can make it something like this...

Dim Var1 as Double
Dim Var2 as Double
Dim SubTotal As Double

Var1 = CDbl(Text1.text) * 0.16
Var2 = 0.16
SubTotal = Var1 + Var2 
'Label1 Shows the value of SubTotal
Label1.Caption = SubTotal

Var2 is the tax code e.g 16%, just like that.. Hope it helps...


where A is the tax code e.g 16%

this line is not clear to me. so need more information. did you declare any variable for A? or do you want to calculate 16%?

Edited by abu taher: same time post


thanks Jhai u were a great help.
to Abu i had declared A=16%

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.