Total of a Table's Field in Access Form

This one is probably a no-brainer, but I must not be thinking clearly. I have a field in a table and I want to place the total of the values in the field onto a form. Example - fields in table contain PassesIssued to a certain event. I want to aggregate those fields (that meet a certain set of conditions) and place that total on the form. So, my form could say the total number of passes issued.
jcaiolaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

RyanProject Engineer, ElectricalCommented:
A Query
Select Sum(PassesIssued) as SumOfPassesIssued FROM tblTableName

A Function in textbox
Set the control Source to
=DSum("PassesIssued","TblTableName","WHERE TRUE")
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
grendel777Commented:
Hi jcaiola, the easiest (though not fastest) way to do it is to set a textbox's controlsource to a DSUM function.  DSUMs can be slow so I advise against using too many of them on any form or report.
=DSUM("PassesIssued","tblPasses")

Open in new window

0
grendel777Commented:
Sorry MrBullwinkle, we were typing at the same time!
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

jcaiolaAuthor Commented:
What does the Where True statement do?
0
grendel777Commented:
The last component is an optional criteria, basically a WHERE clause if you want to limit the rows summed.  For example, if you wanted to sum the passes for a particular customer, you could put:

=DSUM("PassesIssued","tblPasses", "CustID = 123456")

"Where TRUE" just explicitly says "show me everything," which is the functional equivalent of leaving it blank.  MrBullwinkle was letting you know it's there if you need it.  Give him the points (if this works for you) - he was there first.

Good luck!
0
jcaiolaAuthor Commented:
Thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.