Subtotal on form

  • Thread starter Thread starter Dean
  • Start date Start date
D

Dean

Four text boxes that the user enters amounts into, is it possible to have a
running total in a label on that form. It will obviously change to the sum
of all fields on the form as the records change.

Anyone tell me how please.

Thanks
Dean
 
Dean said:
Four text boxes that the user enters amounts into, is it possible to have a
running total in a label on that form. It will obviously change to the sum
of all fields on the form as the records change.

Anyone tell me how please.

Thanks
Dean

Add this code for each of the four text boxes
Private Sub Text1_AfterUpdate()
lblAnswer.Caption = Val(Nz(Me.Text1, 0)) + Val(Nz(Me.Text2, 0)) + _
Val(Nz(Me.Text3, 0)) + Val(Nz(Me.Text4, 0))
End Sub
 
Back
Top