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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top