Yes, use the Nz function on both:
[Totalammount1] = Nz([Quant1],0) * Nz([Perprice1],0)
[Totalammount2] = Nz([Quant2],0) * Nz([Perprice2],0)
:
=[Quant1]*[Perprice1] totals up a field called [TotalAmmount1]
=[Quant2]*[Perprice2] totals up a field called [TotalAmmount2]
Should these also be in Perentesis as well, could that be causing my problem?
--
-------------------------
I only speak in php/mySQL
so excuse my english....
-------------------------
http://www.gzws.com
:
As to your previous post, brackets are for enclosing object references.
Parantheses have various uses. They are always used in functions and they
are used to separate math operations when you want to be sure they happen in
the order you want.
As to this problem, I don't know. If the line item is blank (nothing typed
in), then is should evaluate to Null, and your calculations should work
correctly. How are you calculating Totalaamount?
:
Wait, I just noticed another problem.
If the line item is BLANK like nothing typed in then the totalammount field
is blank as well. if it is 0 it works fine.
how do I fix this?
--
-------------------------
I only speak in php/mySQL
so excuse my english....
-------------------------
http://www.gzws.com
:
whooo hooo, that did it, Thanks for your help.
Just for Kicks what is the difference between Bracket[ and Perentesis ( )?
--
-------------------------
I only speak in php/mySQL
so excuse my english....
-------------------------
http://www.gzws.com
:
Incorrect syntax.
Should be parantheses rather than brackets
=Nz(Quant1,0)*Nz(PerPrice1,0)
:
When I type in =Nz[Quant1,0]*Nz[PerPrice1,0] I get an expression error. I am
assuming that is what you meant.
When I try it on the =[TotalAmmount1+[TotalAmmount2] field I get the same
error.
It tells me that it is missing an opperator?
--
-------------------------
I only speak in php/mySQL
so excuse my english....
-------------------------
http://www.gzws.com
:
=[Quant1]*[Perprice1] totals up a field called [TotalAmmount1]
=[Quant2]*[Perprice2] totals up a field called [TotalAmmount2]
then at the bottom of my form I have a field called "OrderTotal" with the
expression
=[TotalAmmount1]+[TotalAmmount1] and it works as long as there is somthing
in the total ammount field. If it is Null or 0 nothing Sums up.
I hope that is clearer than my last post. I wrote it again cause I thought
the last one I wrote was confusing.
--
-------------------------
I only speak in php/mySQL
so excuse my english....
-------------------------
http://www.gzws.com
:
So how do you populate [totalammount1] and [totalammount2]?
It would not be the totals calculation that would need the Nz, but in the
calculation for each line. The Nz function converts Null to 0, so if you are
converting at the detail level, there will not be a problem at the total
level.
:
I do not have that expression in my total field. I have =[quant1]*[perprice1]
on each line item and the total price field at the bottom I have
=[totalammount1]+[totalammount2]+ instead of the ( ) that you stated so I am
not sure where that Nz expression you told me about goes.
Thanks for all your help.
--
-------------------------
I only speak in php/mySQL
so excuse my english....
-------------------------
http://www.gzws.com
:
Null values in unfilled rows are causing the problem. Just wrap your values
in Nz functions:
=Nz(QTY,0)*Nz(Price,0)
:
Hello all:
I have a form where I am adding up the totals of a sales order at
the bottom. The Form has a line by line sales order with the calculation of
=QTY*Price in it. The calculation works fine but when I go to total at the
bottom is does not work unless there is a 0 in each line.
How do I set it up so that the new field at the bottom totals regaurdless if
there is a number or it is blank?
THanks for any help in this,