shad0wslay3r
01-03-2008, 12:20 PM
I am trying to get a running total of some items entered, and it works just fine when i am not using the Format$, but when I try to convert it to a running total the output is always zero.
Private Sub Command1_Click()
If Check1.Value = 1 Then discount = ((Val(Text1.Text) * (Val(Text2.Text) / 100 + 1)) * 0.1) 'calculating the discount with tax included.
If Check1.Value = 0 Then discount = 0
'stating no discount if box is unchecked
Label5.Caption = Format$(Val(Text1.Text) * (Val(Text2.Text) / 100 + 1) - discount, "currency")
'if i remove the format$ here, and in the next line I will get a running total in label7.caption. however with format$ involved it always returns $00.00
Label7.Caption = Format$(Val(Label7.Caption) + Val(Label5.Caption), "currency")
End Sub
Private Sub Command1_Click()
If Check1.Value = 1 Then discount = ((Val(Text1.Text) * (Val(Text2.Text) / 100 + 1)) * 0.1) 'calculating the discount with tax included.
If Check1.Value = 0 Then discount = 0
'stating no discount if box is unchecked
Label5.Caption = Format$(Val(Text1.Text) * (Val(Text2.Text) / 100 + 1) - discount, "currency")
'if i remove the format$ here, and in the next line I will get a running total in label7.caption. however with format$ involved it always returns $00.00
Label7.Caption = Format$(Val(Label7.Caption) + Val(Label5.Caption), "currency")
End Sub