Sum Multiple records and display in text box

Mcgregorbart

New member
Local time
Today, 15:50
Joined
Jul 30, 2010
Messages
11
Hi All
Novice in access 2007. I have a welcome form with various options. On this form I would like a textbox visible showing the current total value of a number of records. I have these records in a query and able to total them but i would like this total value displayed on welcome form for people to see as soon as they open database. can this be done thanks in advance for your assistance.
 
In the Control Source for your Unbound Textbox enter

= DCount("*", "YourQueryName")

replacing YourQueryName with the actual name of the underlying Query.

Welcome to AWF!

Linq ;0)>
 
Bart,

It wasn't 100% clear from your question whether you meant to show the number of records (which is what Linq's solution will do), or the total value of a particular field.

If the latter, use:
=DSum("[NameOfYourField]","NameOfYOurQuery")

Or, if your query already is a Totals Query that gives the sum total, then:
=DLookup("[NameOfTheTotalField]","NameOfYourQuery")
 
Thank you both terrific help and yes Steve it was the sum total of records I was after
Nice place this thanks again
 
this is helpful, but how can i get a total I have in a sub-form (located in the footer of the sub form) to display in my main form?
 
Ljmellor,

Put an unbound textbox on the main form. In its Control Source, enter the equivalent of this:
=[NameOfSubform]![NameOfTotalsBoxOnSubform]
 

Users who are viewing this thread

Back
Top Bottom