Display a total from a query

Snarg

New member
Local time
Today, 08:30
Joined
Jan 21, 2007
Messages
8
Well, I'm not certain if this is a function of a query or a report. Since I eventualy want this displayed on a report, I went with the 'Reports' forum. If this is the wrong place, please move it to where it belongs. And now, my question...

I managed to figure out how to build a query using a range of dates and display said query in a report (Yay me!). What I would like to do is tack the total number of records returned on the end of the report. I have, of course, tried searching the forums and reading the (not always helpful) help file. Otherwise I would not be bothering you :)

I can display the 'Total' field in the query however it adds gives me some kind of crazy results when I run the query.

I'll attach a screenshot of the report (in all it's glorious ugliness) with a box showing where I would like the total.

Thank you for your time and patience.
 

Attachments

  • report.jpg
    report.jpg
    24.2 KB · Views: 200
In the controlsource of the text box, put:
Code:
=Count([Sensor Number])
 
And just as a side note, you may want to change the spelling of Maintainence to Maintenance.
 
boblarson said:
In the controlsource of the text box, put:
Code:
=Count([Sensor Number])
I am sorry to say this is not quite what I was looking for. When I open the report it asks me for the start and end date, like normal. However, it then asks me for a sensor number. Also, the text box is displayed multiple times on every page.

I think the failure lies with me, however. I don't think I adquetly explained what I am looking for. What I would like to have is a total number of records found by the query displayed on the last page of the report. If there is more information required please let me know.

Once again, thank you very much for your time.

Edit:

boblarson said:
And just as a side note, you may want to change the spelling of Maintainence to Maintenance.
Whoops!
 
Actually I did tell you exactly what you needed in order for it to work. But, you didn't quite understand what I meant, apparently. The text box where you want the total count of the records has to be in the Report Footer and not the details section. Second, if it is asking you for [Sensor Number] then you either put the code in the query instead of in the control source of the text box or you don't have a field named Sensor Number. If you don't have a field with that name, then you need to substitute one of the actual field names on the report for that one. Let's see if you can try it again. I am attaching a sample. Open rpt2 to see what I did.
 

Attachments

It took me a while to realize there was a difference between the page footer and the report footer. Then it took me forever to figure out how to add anything to the report footer. However, I finaly have it done. Thank you boblarson for your time and patience.
 

Users who are viewing this thread

Back
Top Bottom