Accsess Form

  • Thread starter Thread starter Kenj
  • Start date Start date
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.
 
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
 
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])
 
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....)
 
Back
Top