How do you get calculated fields on access forms

J

Jeff

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
 
F

fredg

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.
 
D

Dirk Goldgar

Jeff said:
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)
 

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