A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How do you get calculated fields on access forms



 
 
Thread Tools Display Modes
  #1  
Old January 7th, 2010, 05:48 PM posted to microsoft.public.access.forms
Jeff
external usenet poster
 
Posts: 1,347
Default How do you get calculated fields on access forms

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
  #2  
Old January 7th, 2010, 06:02 PM posted to microsoft.public.access.forms
fredg
external usenet poster
 
Posts: 4,386
Default How do you get calculated fields on access forms

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
  #3  
Old January 7th, 2010, 06:08 PM posted to microsoft.public.access.forms
Dirk Goldgar
external usenet poster
 
Posts: 2,529
Default How do you get calculated fields on access forms

"Jeff" wrote in message
...
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)

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:49 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.