How do I add field totals

B

BobC

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
 
J

Jeff Boyce

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

fredg

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
 

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