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 I add field totals



 
 
Thread Tools Display Modes
  #1  
Old December 12th, 2009, 12:44 AM posted to microsoft.public.access.forms
BobC[_5_]
external usenet poster
 
Posts: 2
Default How do I add field totals

I have a Form with 3 text boxes. I want to add the figures in Box 1 and Box
2 and make it show up in Box 3. How do I do that? Sorry, I'm pretty new to
Access.

Thanks
--
Bobc
SRES, LLC
  #2  
Old December 12th, 2009, 12:56 AM posted to microsoft.public.access.forms
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default How do I add field totals

One way to do this would be to do the calculation in a query, then use that
query to "feed" the form.

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

"BobC" wrote in message
...
I have a Form with 3 text boxes. I want to add the figures in Box 1 and
Box
2 and make it show up in Box 3. How do I do that? Sorry, I'm pretty new
to
Access.

Thanks
--
Bobc
SRES, LLC



  #3  
Old December 12th, 2009, 10:40 PM posted to microsoft.public.access.forms
fredg
external usenet poster
 
Posts: 4,386
Default How do I add field totals

On Fri, 11 Dec 2009 16:44:01 -0800, BobC wrote:

I have a Form with 3 text boxes. I want to add the figures in Box 1 and Box
2 and make it show up in Box 3. How do I do that? Sorry, I'm pretty new to
Access.

Thanks


Well, yes you could in theory. But why would you want to in practice?
As long as you have saved, in a table, the values in "Box1" and Box2"
Let's call them by their more proper names (they are not Boxes).
In a table, they are Fields.
On a Form or Report they are Controls.
Anytime you need to see the sum of the 2 controls, calculate it.
In a query:
SumOfFields: Nz([Field1]) + Nz([Field2])
or directly in the control source of an unbound control on a form or
report:
= Nz([Control1]) + Nz([Control2])

In any event, saving the calculated value is not necessary and can
lead to incorrect stored values if, for example, one of the individual
values is changed in the future.
As a general rule, in Access one does not store calculated values.

Also, look up the Nz function in VBA help
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
  #4  
Old December 13th, 2009, 07:48 PM posted to microsoft.public.access.forms
Linq Adams via AccessMonster.com
external usenet poster
 
Posts: 1,474
Default How do I add field totals

fredg wrote:

"Well, yes you could in theory. But why would you want to in practice...
As a general rule, in Access one does not store calculated values."

Everything you said is true, Fred, but where in the original post

"I have a Form with 3 text boxes. I want to add the figures in Box 1 and Box

2 and make it show up in Box 3. How do I do that?"

did the OP say anything about storing the calculation? All I see is that he
wants the results to show in Box3, which is a reasonable request.

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via http://www.accessmonster.com

 




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 09:52 PM.


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