?
Solved

When creating a table in MS Access 2007. How do I sum a series of detailed records and assign it a field holder (store the sum) in an Access form?

Posted on 2010-09-17
6
Medium Priority
?
429 Views
Last Modified: 2013-11-28
I have a simple detail table that takes a series of suppliers that send us a commodity and the columns need to be summed.
                                                    Suppliers       Weights

                                                     ACME            1000 lbs
                                                     ABC Co         1200 lbs
                                                     XYZ Co          1150 lbs
                     I need the count of suppliers and total weights summary below
                                                         3                3350 lbs

I think I need to create a field for each summary ten some how build the formula or expression that will add those up. Is that right and do you have an example in steps of how to do that?
0
Comment
Question by:ruavol2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 65

Accepted Solution

by:
rockiroads earned 1200 total points
ID: 33706273
no field, you should never created fields you build on calculations

sql (queries) can handle this

count returns count of rows
sum returns total

eg create a query

select count(*) as TotalSuppliers, SUM(Weights) AS TotalWeights
from mytable

if unfamilair with queries you can do this in design view also
0
 
LVL 48

Assisted Solution

by:Dale Fye
Dale Fye earned 400 total points
ID: 33706277
a single query will do this.

SELECT COUNT(Suppliers) as CountOfSuppliers, SUM(Weights) as SumOfWeights
FROM yourTable

To do this from the query grid, drag the suppliers and weights fields into the grid.  Then click the "Totals" button in the Query Design ribbon, and change the Total Row in the query grid to Count and Sum (as appropriate).
0
 
LVL 65

Assisted Solution

by:rockiroads
rockiroads earned 1200 total points
ID: 33706293
non programmatic way

open up new query, go to design, select your table and fields you want (suppliers and weights)

below on the field, right click and select totals

in the totals row select COUNT on the suppliers and SUM on the weights

then run your query. The sql generated should look something like what I posted
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 3

Assisted Solution

by:AccessYourBiz_Com
AccessYourBiz_Com earned 400 total points
ID: 33713046
The easiest way to do this is to create a totals row within a datasheet veiw form. To learn how to do that you can google
"Access 2007 add total row" or just follow this link.
http://www.ehow.com/how_2125021_use-access-2007-aggregate-functions.html
 
0
 

Author Closing Comment

by:ruavol2
ID: 33828316
Sorry I forgot to get back to this one. Great stuff my appologies for the late rewards.
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 33828360
No worries and thanks :)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question