Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Help with Adding Values in Individual Text Boxes

Status
Not open for further replies.

SoulBrutha23

Technical User
Sep 26, 2001
8
US
I need help. I am a beginner in VBA. There is a Access database that I am developing. In a form, I have some text boxes that will have numeric values in them. I need a procedure that will add up each number as inputed and will automatically give me a total in another text box. The total text box will automatically refresh with the correct number. ex. ---- stands for text box

label155 ----
label156 ----
label157 ----

Total ----

I need help please.....thanks!!!!!
 
In the on exit event of each text box box, type:
call CalculateTotal()

Then cut & paste & modify this code as needed:

Private Sub CalculateTotal()
txtTotal = txt1 + txt2 + txt3 ......
End Sub

txtTotal is the textbox (or label) that you want the total displayed in. txt1, txt2 etc are the text boxes that have the values.... Tyrone Lumley
augerinn@gte.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top