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
402 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 300 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 47

Assisted Solution

by:Dale Fye (Access MVP)
Dale Fye (Access MVP) earned 100 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 300 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
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
LVL 3

Assisted Solution

by:AccessYourBiz_Com
AccessYourBiz_Com earned 100 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

Suggested Solutions

Title # Comments Views Activity
Out in left field or not to far off base 8 69
GA Ribbon creator 9 60
Unable to reference a control field in a subform 9 21
Tabbed form question 5 18
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
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…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

732 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