Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Totaling Numbers in a Report 1

Status
Not open for further replies.

MMSMSD

Technical User
Aug 12, 2005
93
US
Hi,
This is hopefully a very silly question but I'm stuck right now. I have a table that lists individual numbers as such:

DATE NUMBER
8/1 3.3
8/2 4.5
8/5 2.0
9/1 3.5
9/2 3.7

I made a query that asks me for a start and end date, so that I only see the records that correspond to a particular date range. That works fine. I then made a report from that query to format it for printing. That looks fine.
I want to add a field in the report (or the query) that simply adds the numbers of the records shown. Unfortunately, everything I try results in either #ERROR or 3.3 (the first entry on the list). I got 3.3 by using the RUNNING SUM option but it doesn't want to SUM anything! What kind of expression, and WHERE, do I need to use to get it to simply add the numbers? Thanks.
 
MMSMSD
In your Report Footer, put a text box control that has the following expression...
Code:
=Sum([Number])

Note that this goes in the Report Footer, not the Page Footer.

The only caveat is that you should not name fields either "Date" or "Number" as they are reserved words in Access. You may have just shown that for example, but I thought I should mention it.

Tom
 
Tom,
'Number' was, as you surmised, an example. Thanks for the reminder though. I was able to figure out my problem, based on your 'Note'. The key was putting it in the Report Footer. My list was in a sub-form, so I needed to put my code in the Report Footer of the sub-form and then reference that field in the main form. Works like a charm now.

Thanks for the help!

Michael
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top