Hey, everybody,
I would like to know if you can help me code to SUM the 6 textbox values, they are UserFormCustomer, MultiPage and the textBox with the names "txtAmountInv1", "txtAmountInv2" .etc. Values are populated with this procedure:
Private sub txtPerUnitInv6_Change()
Dim q As Double
Dim t As Double
If IsNumeric (txtPerUnitInv6.Value) Then
If txtPerUnitInv6.Value <> "" Then t =
txtPerUnitInv6.Value
If txtQty6.Value <> "" Then q = txtQty6.Value
txtAmountInv6.Value = t * q
End if
If txtPerUnitInv6.Value = "" Then
txtAmountInv6.Value = ""
End if
End Sub
There are 4 more text boxes- txtAmountExpense1,txtAmountExpense2, etc. In the same MultiPage, the values are filled in manually. I want to ADD txtSub-Total plus the values of 4 texBox. The SUM must appear in the textbox called txtTotalGeral. Thank you very much.
The basic code could be something like this:
Dim counter as long
for counter = 1 to 4
Dim RunningTotal as Double
RunningTotal = RunningTotal + CDbl("0" & Me.controls("txtAmountExpense" & n).Text)
Next counter
RunningTotal = RunningTotal + CDbl("0" & Me.controls("txtSub-Total").Text)
txtTotalGeral.Text = RunningTotal
thanks for trying to help.