Accsess Form

K

Kenj

I Have a broblem with this =[Line Total1]+[Line Total2]+[Line Total3]
+[Line Total4]+[Line Total5]+[Line Total6][Line Total7]+[Line Total8]+[Line
Total9]+[Line Total10]+[Line Total11]+[Line Total12]+[Line Total13]+[Line
Total14]+[Line Total15]+[Line Total16]+[Line Total17]+[Line Total18]+[Line
Total19]+[Line Total20]+[Line Total21]+[Line Total22]+[Line Total23]+[Line
Total24]+[Line Total25] If I dont put data in all the fields I get anything.
 
G

Gina Whipp

Kenj,

Because you can't add a number to nothing, so we have to account for the
nothingness. Each 'Line Total' must be *wrapped* with Nz(), ie...

Nz([Line Total1],0)

As a side note, a little concerned about your table set up. It looks like
you commited spreadsheet with your database. Perhaps if you elaborate we
can offer a better solution.

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 
P

Piet Linden

I Have a broblem with this =[Line Total1]+[Line Total2]+[Line Total3]
+[Line Total4]+[Line Total5]+[Line Total6][Line Total7]+[Line Total8]+[Line
Total9]+[Line Total10]+[Line Total11]+[Line Total12]+[Line Total13]+[Line
Total14]+[Line Total15]+[Line Total16]+[Line Total17]+[Line Total18]+[Line
Total19]+[Line Total20]+[Line Total21]+[Line Total22]+[Line Total23]+[Line
Total24]+[Line Total25] If I dont put data in all the fields I get anything.

wrap them in Nz([Line Total1])
 
F

fredg

I Have a broblem with this =[Line Total1]+[Line Total2]+[Line Total3]
+[Line Total4]+[Line Total5]+[Line Total6][Line Total7]+[Line Total8]+[Line
Total9]+[Line Total10]+[Line Total11]+[Line Total12]+[Line Total13]+[Line
Total14]+[Line Total15]+[Line Total16]+[Line Total17]+[Line Total18]+[Line
Total19]+[Line Total20]+[Line Total21]+[Line Total22]+[Line Total23]+[Line
Total24]+[Line Total25] If I dont put data in all the fields I get anything.

Look up the Nz function in VBA help.
=Nz([Line Total1],0)+Nz([Line Total2],0) + Nz(etc....)
 

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

Similar Threads

Forms Calculations 1

Top