Connecting Tech Pros Worldwide Help | Site Map

Text Box Control unbound doesnt Sum

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 12th, 2005, 06:52 PM
Marco Simone
Guest
 
Posts: n/a
Default Text Box Control unbound doesnt Sum

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



  #2  
Old November 12th, 2005, 06:52 PM
Jim Allensworth
Guest
 
Posts: n/a
Default 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
  #3  
Old November 12th, 2005, 06:52 PM
Bas Cost Budde
Guest
 
Posts: n/a
Default 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

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.