By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,486 Members | 2,034 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,486 IT Pros & Developers. It's quick & easy.

Sum of multiple text boxes on form

P: 10
Hi there,

I am trying to add together 4 fields on a form to give total sumation. I have created the expression:

Expand|Select|Wrap|Line Numbers
  1. =Nz([txtprice],0)+Nz([txtshippping],0)+Nz([txtimporttax],0)+Nz([txtadditionalcosts],0)
But when values are entered into the appropriate txt boxes instead of adding all the values together to give a sumation, it just adds them together i.e. if the numbers in the text boxes are 3, 4, 5 and 6, I want to add them together to get 18, whereas the expression gives 3456!

Any ideas!
Mar 12 '14 #1
Share this Question
Share on Google+
2 Replies


Expert 100+
P: 1,221
NZ returns a string value. Try
Expand|Select|Wrap|Line Numbers
  1. Cdbl(Nz([txtprice],0))+Cdbl(Nz([txtshippping],0))+Cdbl(Nz([txtimporttax],0))+Cdbl(Nz([txtadditionalcosts],0))
Also pay attention to the formatting on the text box that will display this sum.

Jim
Mar 12 '14 #2

P: 10
Thanks it worked first time!!
Mar 12 '14 #3

Post your reply

Sign in to post your reply or Sign up for a free account.