hi guys thanks for all your help previously,i am having a problem displaying the grand total.this is the scenario:
i have several buttons which are used to compute various taxes e.g D1, D2,D3....subtotal
i would like when i compute using D1 i get the total displayed,if i press d2 i also get the total displayed and so on.this is the code i used in the total command button

Private Sub cmdtotal_Click()
  If readout = var1 Then
         readout = var1
  ElseIf readout = var2 Then
         readout = var2
  ElseIf readout = subtotal Then
         readout = subtotal
End If
     
End Sub

'var1= readout*0.16
'var2=readout*0.12
'subtotal=var1+var2

when i press the total button nothing is showing.please help.
thanks

First, When someone solves your problem you must mark it as Solved... Thanks.

Second, in your code, I didn't see where do you want to show the Total for it. Will it be showed in Textbox? in Label?..

Assigning Value in a Textbox Control using Text Property

Text1.Text = readout
or
Text1.Text = subtotal

Assigning Value in a Label Control using Caption Property

Label1.Caption = readout
or
Label1.Caption = subtotal

you can do it something like that...

thanks jhai, it works

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.