From: Jeff on
I am trying to get a simple calculated field on a form - one that adds other
fields (e.g. =Maxinv1+maxinv2+maxinv3 ) but it wont add - what am I doing
wrong
From: fredg on
On Thu, 7 Jan 2010 09:48:01 -0800, Jeff wrote:

> I am trying to get a simple calculated field on a form - one that adds other
> fields (e.g. =Maxinv1+maxinv2+maxinv3 ) but it wont add - what am I doing
> wrong

What does 'Won't add' mean?
Do you get #error displayed in the control?
Do you get an incorrect result?
Do you get no result?
Do all of the fields have a value or are some Null?
If so, did you use the Nv() function in the expression?
If not, look it up in VBA help and try it.
=Nz(Maxinv1,0)+Nz(maxinv2,0)+Nz(maxinv3,0))

If that doesn't 'fix' it then, please post your exact expression.
Please give us an example of the data in those fields and the result
you expect.
Please give us what the actual result of your example data is.
Please include your Access version number.

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
From: Dirk Goldgar on
"Jeff" <Jeff(a)discussions.microsoft.com> wrote in message
news:1E26270F-8782-4E9C-BBCD-C3FACD17443E(a)microsoft.com...
>I am trying to get a simple calculated field on a form - one that adds
>other
> fields (e.g. =Maxinv1+maxinv2+maxinv3 ) but it wont add - what am I doing
> wrong


What exactky have you done, and what was the (presumably undesired) result?

If Maxinv1, maxinv2, and maxinv3 are controls on the form, setting the
controlsource of a fourth control to:

=[Maxinv1]+[maxinv2]+[maxinv3]

.... ought to work, except that if any of those three controls is Null, the
result will be Null. If that's your problem, you can use a controlsource
expression like this:

=Nz([Maxinv1], 0)+Nz([maxinv2], 0)+Nz([maxinv3], 0)

--
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html

(please reply to the newsgroup)