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

Text Box Control unbound doesnt Sum

P: n/a
Hi,

I have form with four text box controls.
3 text box controls are bound to table A, and 4 text box control sums values
in this 3 text boxes with formula in Control source.
txtBox4=[txtBox1]+[txtBox2]+[txtBox3]
If I dont enter number in one of text boxes, txtBox4 doesn't show result. I
guess it considers it is Null value.
I would like that if I dont enter number in text box, txtBox4 considers it
as number 0.
Does anyone know how to fix this?

Thanks for your help, Marco
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Tue, 3 Feb 2004 23:27:37 +0100, "Marco Simone" <ma*********@net.hr>
wrote:
Hi,

I have form with four text box controls.
3 text box controls are bound to table A, and 4 text box control sums values
in this 3 text boxes with formula in Control source.
txtBox4=[txtBox1]+[txtBox2]+[txtBox3]
If I dont enter number in one of text boxes, txtBox4 doesn't show result. I
guess it considers it is Null value.
I would like that if I dont enter number in text box, txtBox4 considers it
as number 0.
Does anyone know how to fix this?

Thanks for your help, Marco

Nulls propogate through an expression.

Use the Nz function to convert it to a zero for summing. In the
control source for the textbox use...
= Nz ([txtBox1]) + Nz ([txtBox2]) + Nz ([txtBox3])

- Jim
Nov 12 '05 #2

P: n/a
Marco Simone wrote:
Hi,

I have form with four text box controls.
3 text box controls are bound to table A, and 4 text box control sums values
in this 3 text boxes with formula in Control source.
txtBox4=[txtBox1]+[txtBox2]+[txtBox3]
If I dont enter number in one of text boxes, txtBox4 doesn't show result. I
guess it considers it is Null value.
I would like that if I dont enter number in text box, txtBox4 considers it
as number 0.
Does anyone know how to fix this?


Yes, wrap every reference in the Nz() function. The expression becomes
txtBox4=nz([txtBox1])+nz([txtBox2])+nz([txtBox3])
--
Bas Cost Budde
http://www.heuveltop.nl/BasCB

Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.