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!

Report with totals only in footer; no details

Status
Not open for further replies.

lorirobn

MIS
Mar 15, 2005
450
US
Hi,

I'm creating a one-page report that will only total counts, no details. I set up my report fields on the report's Footer section. I have to examine the values of 2 fields on the table rows being read, and add to appropriate counters. Field 1 can have 3 values, field 2 can have 5 values. I have to count each iteration/combination.

My question is: where do I put this logic to look at detail records. If no details are being displayed, does this mean I cannot use the DetailFormat event? I did set up a Detail_Format event, where I have an IF statement to add to counts, but this is not getting executed. Once I finish adding to the counts and reading through all rows, I will display counts, to then display in the report's footer?

I am relatively new to Access programming (was a COBOL programmer), so feel free to give any suggestions on the best way to do this.

Thanks in advance,
Lori
 
Hi Lori!

Can you do your totals in a query and then base the report on your query? If you can that would be easier. You can post your table layout with some sample data so we can get a better idea about what you want to do and what will be possible for you.

hth


Jeff Bridgham
Purdue University
Graduate School
Data Analyst
 
Thanks, Jeff. I'm not sure how I would do my totals in a query, as they are conditional.

Here is some information about my table. It has a row for each bed in the building (guest-type house). Each bed has a MattressCondition, and a MattressSize field.
MattressCondition values are 1,2,3,4,5.
MattressSize values are T,D,Q.

I want to simply COUNT, based on the two fields, how many:
- twin beds ("T") that are condition '1' (poor)
- twin beds that are condition 2
... and so on
- double beds that are condition '1'
- double beds that are condition '2'
...and so on
- queen beds that are condition '1'
- queen beds that are condition '2'
... and so on.

So the one page of my report would look like this, with a gridlined table:

Cond 5 Cond 4 Cond 3 Cond2 Cond1
Bed Size
Twin 100 5 2 1 1
Double 25 2 2 1 1
Queen 25 1 1 1 1

I thought I could do an IF statement, checking the values of the 2 fields, and adding to my own counters. But because I don't have a Detail section of the report, I can't figure out where to even put such an IF statement??? Can I make one query to test and count all these conditions? (sorry, I've been using Access for a few months now, but still have a lot to learn).

Thanks for your help!

Lori
 
To update my thread: I created a Crosstab query, and this gave me exactly the results that I need!

(but how do I get rid of the column that is headed "<>" though?).

Thanks all!
Lori
 
You set a criteria of WHERE MattressCondition Is Not Null.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Thanks, Duane - got rid of the column! (and like your signature re: questions and answers!).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top