Text Box Problem

D

denyoung

On a form, I am attempting to add numbers (currency) in a text box based on
fields in a record. The sum displays correctly when there are values (or 0)
in all of the 5 fields being added but displays nothing when one or more of
the fields is NULL. Is there a way to force the sum to appear when one (or
more) of the added fields is NULL?

Thanks
 
D

Douglas J. Steele

Nz(Field1, 0) + Nz(Field2, 0) + Nz(Field3, 0) + Nz(Field4, 0) + Nz(Field5,
0)
 
F

fredg

On a form, I am attempting to add numbers (currency) in a text box based on
fields in a record. The sum displays correctly when there are values (or 0)
in all of the 5 fields being added but displays nothing when one or more of
the fields is NULL. Is there a way to force the sum to appear when one (or
more) of the added fields is NULL?

Thanks

Look up the Nz function in VBA help.
=Nz([Field1],0) + Nz([Field2],0) + Nz([Field3],0) + etc.....
 
D

denyoung

Thanks.
--
Dennis


Douglas J. Steele said:
Nz(Field1, 0) + Nz(Field2, 0) + Nz(Field3, 0) + Nz(Field4, 0) + Nz(Field5,
0)

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)





.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top