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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't calculate what is visible on report

Status
Not open for further replies.

mobile2

Programmer
Dec 19, 2002
38
0
0
GB
Hi there, I am using MS Access 97 and have created a report with the following headers, Report, Page, CountyName, Town, Applications, CompanyName. The Detail section contains ContactNames within each company. What I want to do is show on the report how many CompanyNames are within a CountyName. I have done this already for ContactName by using the following calculated expression in the CountyName header e.g. =Count([ContactName]) but when I try to use =Count([CompanyName]) it gives me the same results. Because the CompanyName has been grouped and has a header of its own it only shows the CompanyName once instead of duplicating for each contact. Is there a way I can calculate only the CompanyNames shown on the report and not for each ContactName within that CompanyName. I hope I have explained this OK and would be very grateful for advice. Thank you
 
You might have to include a sub report on your report that shows the total of Company Names by country. This sub report would be based on a query that you would have count the company names within each country, and thats all. You can then place this sub report strategically on your report so it reads the way you want - usually in the report footer area.

This process has worked well for me many times. Good luck and let me know if this helps or if you need more assistance.
 
Sorry for taking so long to get back to you. I took your advice and added the sub-report. I also used the DSum function to retrieve the Total I needed. My report has everything I need now. Thanks for the help - you guys are great!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top