Connecting Tech Pros Worldwide Help | Site Map

Text Box Control unbound doesnt Sum

Marco Simone
Guest
 
Posts: n/a
#1: Nov 12 '05
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


Jim Allensworth
Guest
 
Posts: n/a
#2: Nov 12 '05

re: Text Box Control unbound doesnt Sum


On Tue, 3 Feb 2004 23:27:37 +0100, "Marco Simone" <marcosimone@net.hr>
wrote:
[color=blue]
>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
>
>[/color]
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
Bas Cost Budde
Guest
 
Posts: n/a
#3: Nov 12 '05

re: Text Box Control unbound doesnt Sum


Marco Simone wrote:
[color=blue]
> 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?[/color]

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

Closed Thread