Nz Function

sondriven

Registered User.
Local time
Today, 18:03
Joined
Jun 13, 2002
Messages
158
I have five text boxes that Im adding up. Some of them could be blank. Right now my formula is this:

=[Text70]+[Text72]+[Text74]+[Text75]+[Text76]

I need a Nz formula for this for the times a box is empty. I tried this but it doesnt work.

=Sum(Nz([Text70],0)+Nz([Text72],0)+Nz([Text74],0)+Nz([Text75],0)+Nz([Text76],0))

I know its wrong but thought id give it a try. MSaccess2k help doesnt delve into Nz function examples too much.

Thanks again.
 
I use this in my db and don't have any problems with it.

=nz([txtnew])+nz([txtRR])+nz([txtRepair])+nz([txtPaint])

Questions.

I presume your texts are numeric.

Do they have any default values ?

Are they Null, as in blank or do they have a zero in them.

Dave
 
You want

=Nz([Text70])+Nz([Text72])+Nz([Text74])+Nz([Text75])+Nz([Text76] )

I left out the zeros Nz([Text70],0) because that's the default behaviour.

HTH
 

Users who are viewing this thread

Back
Top Bottom