VB Code:
'to calculate totals use this:
Private Sub cmdCalc_Click()
'validate first textbox
With Text1
If Not IsNumeric(Trim(.Text)) Then
MsgBox "Invalid entry"
.SelStart = 0
.SelLength = Len(.Text)
.SetFocus
Exit Sub
End If
End With
'validate second textbox
With Text2
If Not IsNumeric(Trim(.Text)) Then
MsgBox "Invalid entry"
.SelStart = 0
.SelLength = Len(.Text)
.SetFocus
Exit Sub
End If
End With
'calculate total amount
txtTotal.Text = Format(CCur(Text1.Text) + CCur(Text1.Text), "$0.00")
End Sub
Must i add this line to my summary and calculate button?
Or only calculate button?