446,190 Members | 849 Online
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,190 IT Pros & Developers. It's quick & easy.

# calculating Total in a textbox on a form, how can I calculate the total of several text boxes in another textbox on the same form?

 P: n/a I have a form with three text boxes on it. I want the third text box to show the total of the values in the other two text boxes. The first box is named: BoxOne and I type the number 2 into it The second box is named: BoxTwo and I type the number 3 into it If the third box is named: TotalBox and the control source for the TotalBox reads, =([BoxOne]+[BoxTwo]) the value in the total box is 23, not 5 It just places the two separate values side-by-side in the totalbox. If I use =([BoxOne]*[BoxTwo]) then I get 6 (two TIMES three) I tried using sum in various ways but I just got error messages. Can anyone help with this. Nov 12 '05 #1
5 Replies

 P: n/a "+" is both an arithmetic and a string operator. As a string operator, it concatenates the two values. This is what you are seeing! Access thinks Box1 and Box2 in the expression in the control source are both strings so it concatenates to get 23. Format Box1 and Box2 as number and you will get the arithmetic operation you want in the TotalBox. -- PC Datasheet Your Resource For Help With Access, Excel And Word Applications re******@pcdatasheet.com www.pcdatasheet.com "RC" wrote in message news:3c**************************@posting.google.c om... I have a form with three text boxes on it. I want the third text box to show the total of the values in the other two text boxes. The first box is named: BoxOne and I type the number 2 into it The second box is named: BoxTwo and I type the number 3 into it If the third box is named: TotalBox and the control source for the TotalBox reads, =([BoxOne]+[BoxTwo]) the value in the total box is 23, not 5 It just places the two separate values side-by-side in the totalbox. If I use =([BoxOne]*[BoxTwo]) then I get 6 (two TIMES three) I tried using sum in various ways but I just got error messages. Can anyone help with this. Nov 12 '05 #2

 P: n/a On 15 May 2004 11:42:32 -0700, RC wrote: I have a form with three text boxes on it. I want the third text box to show the total of the values in the other two text boxes. The first box is named: BoxOne and I type the number 2 into it The second box is named: BoxTwo and I type the number 3 into it If the third box is named: TotalBox and the control source for the TotalBox reads, =([BoxOne]+[BoxTwo]) the value in the total box is 23, not 5 It just places the two separate values side-by-side in the totalbox. If I use =([BoxOne]*[BoxTwo]) then I get 6 (two TIMES three) I tried using sum in various ways but I just got error messages. Can anyone help with this. Access is treating the entries as though they were Text, not numbers. Set the Format property of each of the controls to General Number (or any of the other Number Formats, i.e. Fixed, Standard, etc.). -- Fred Please only reply to this newsgroup. I do not reply to personal email. Nov 12 '05 #3

 P: n/a Sounds like you have either the fields in the table or the boxes on the form set to text and not number. rc*********@yahoo.com (RC) wrote in message news:<3c**************************@posting.google. com>... I have a form with three text boxes on it. I want the third text box to show the total of the values in the other two text boxes. The first box is named: BoxOne and I type the number 2 into it The second box is named: BoxTwo and I type the number 3 into it If the third box is named: TotalBox and the control source for the TotalBox reads, =([BoxOne]+[BoxTwo]) the value in the total box is 23, not 5 It just places the two separate values side-by-side in the totalbox. If I use =([BoxOne]*[BoxTwo]) then I get 6 (two TIMES three) I tried using sum in various ways but I just got error messages. Can anyone help with this. Nov 12 '05 #4

 P: n/a THANK YOU! Thank You, Thank You. I wasted so much time on this one. I was sure the syntax to get the total was correct, that's why I kept trying. I finally gave up and asked you all. I set the Format property for the text box to General Number and everthing was fine. Thank all of you so much for the help, now I can move on instead of being stuck. ma********@yahoo.co.uk (Charlie) wrote in message news:<42*************************@posting.google.c om>... Sounds like you have either the fields in the table or the boxes on the form set to text and not number. rc*********@yahoo.com (RC) wrote in message news:<3c**************************@posting.google. com>... I have a form with three text boxes on it. I want the third text box to show the total of the values in the other two text boxes. The first box is named: BoxOne and I type the number 2 into it The second box is named: BoxTwo and I type the number 3 into it If the third box is named: TotalBox and the control source for the TotalBox reads, =([BoxOne]+[BoxTwo]) the value in the total box is 23, not 5 It just places the two separate values side-by-side in the totalbox. If I use =([BoxOne]*[BoxTwo]) then I get 6 (two TIMES three) I tried using sum in various ways but I just got error messages. Can anyone help with this. Nov 12 '05 #5

 P: n/a RC, If you ever decide to look for paid assistance, contact me at the email address below. I am in business to provide customers with a resource for help with Microsoft Access, Excel and Word applications. You can view my website at www.pcdatasheet.com. -- PC Datasheet Your Resource For Help With Access, Excel And Word Applications re******@pcdatasheet.com www.pcdatasheet.com "RC" wrote in message news:3c**************************@posting.google.c om... THANK YOU! Thank You, Thank You. I wasted so much time on this one. I was sure the syntax to get the total was correct, that's why I kept trying. I finally gave up and asked you all. I set the Format property for the text box to General Number and everthing was fine. Thank all of you so much for the help, now I can move on instead of being stuck. ma********@yahoo.co.uk (Charlie) wrote in message news:<42*************************@posting.google.c om>... Sounds like you have either the fields in the table or the boxes on the form set to text and not number. rc*********@yahoo.com (RC) wrote in message news:<3c**************************@posting.google. com>... I have a form with three text boxes on it. I want the third text box to show the total of the values in the other two text boxes. The first box is named: BoxOne and I type the number 2 into it The second box is named: BoxTwo and I type the number 3 into it If the third box is named: TotalBox and the control source for the TotalBox reads, =([BoxOne]+[BoxTwo]) the value in the total box is 23, not 5 It just places the two separate values side-by-side in the totalbox. If I use =([BoxOne]*[BoxTwo]) then I get 6 (two TIMES three) I tried using sum in various ways but I just got error messages. Can anyone help with this. Nov 12 '05 #6

### This discussion thread is closed

Replies have been disabled for this discussion.