creating table of contents for access report

  • Thread starter Thread starter ZB via AccessMonster.com
  • Start date Start date
Z

ZB via AccessMonster.com

Hi All,

I have a main report with 6 subreports (the only way I could make them print
one after the other with consecutive page numbers). The main report is like
a title page for the report. It has a report header (report title)--prints
only on first page--and page footer (today's date and page of pages)--prints
at the bottom of every page. The details section of the main report has
space set aside for a table of contents of sorts. My user wants to see the
report page number where each of the subreports begins. Example: title page
(main report) starts on page 1, subreport_A starts on page 2, subreport_B
starts on page 15, subreport_C starts on page 37, etc. How do I grab the
page numbers when a subreport starts?

I wouldn't start down this road except that the report (with subreports) is
150 pages in length and everybody would get frustrated trying to find
individual sections.

Anybody have any ideas how to accomplish this?

Many thanks in advance for any code snippets or suggestions,
ZB
 
Hi Allen,

Thanks so much for your quick response. I'm implementing this right now...


\ZB

Allen said:
You can use the events of the sections of the report to log the page numbers
to another table, and then print that at the end of the report.

Details in:
How to Create a Table of Contents or Index for a Report
at:
http://support.microsoft.com/default.aspx?scid=kb;en-us;210269
I have a main report with 6 subreports (the only way I could make them
print
[quoted text clipped - 22 lines]
Many thanks in advance for any code snippets or suggestions,
ZB
 
Hi All,

I spent parts of a day and a half picking apart the code and studying
Microsoft's sample reports database and applying it to my situation (1 main
report with 6 subreports). Then spent another 2 days trying to figure out
why all of the individual sections weren't consistently getting to the
TableOfContents report. I went through the Microsoft link that Allen
provided (thank you again!), double, triple, quadruple checked my code, moved
code around, checked Microsoft's instructions and did it again. 4:42pm
yesterday (Thursday), I finally I figured out what was going on. Now I'm
hoping someone can help with the solution.

The note in the second to last step of Microsoft's instructions, step 7, says
"NOTE: When you preview or print the report, the Table of Contents is updated.
The Table of Contents table records the page on which each new category
begins. When you preview the report, page through all of the pages of the
report to make sure that the Print event is triggered for all records."

Ah hah! The last sentence should be rewritten to say, "When you preview the
report, page through all of the pages of the report to triggered the Print
event for all records."

When I finally started clicking on the navigation button that goes to the
last page, I got a complete table of contents for the entire report.
Everytime. My user isn't going to page to the last page and then print the
Table of Contents (I can already see it: I'll get a call from her once every
2 weeks saying that she only got a partial table of contents and to fix it).


What VB code do I use and where do I put it (event or module or ?) so that my
report goes to the last page of the report (thereby causing On Print to
trigger and my tblTableOfContents to populate), then back to the first page
of the report so that, from a user's point of view, the first page is
continually presented?

Again, many thanks in advance for any code snippets or suggestions,
ZB


Allen said:
You can use the events of the sections of the report to log the page numbers
to another table, and then print that at the end of the report.

Details in:
How to Create a Table of Contents or Index for a Report
at:
http://support.microsoft.com/default.aspx?scid=kb;en-us;210269
I have a main report with 6 subreports (the only way I could make them
print
[quoted text clipped - 22 lines]
Many thanks in advance for any code snippets or suggestions,
ZB
 
I found my answer in someone else's posting on Access Monster. I created an
Event Procedure for On Open and put in this code:

SendKeys "{End}"
Hi All,

I spent parts of a day and a half picking apart the code and studying
Microsoft's sample reports database and applying it to my situation (1 main
report with 6 subreports). Then spent another 2 days trying to figure out
why all of the individual sections weren't consistently getting to the
TableOfContents report. I went through the Microsoft link that Allen
provided (thank you again!), double, triple, quadruple checked my code, moved
code around, checked Microsoft's instructions and did it again. 4:42pm
yesterday (Thursday), I finally I figured out what was going on. Now I'm
hoping someone can help with the solution.

The note in the second to last step of Microsoft's instructions, step 7, says
"NOTE: When you preview or print the report, the Table of Contents is updated.
The Table of Contents table records the page on which each new category
begins. When you preview the report, page through all of the pages of the
report to make sure that the Print event is triggered for all records."

Ah hah! The last sentence should be rewritten to say, "When you preview the
report, page through all of the pages of the report to triggered the Print
event for all records."

When I finally started clicking on the navigation button that goes to the
last page, I got a complete table of contents for the entire report.
Everytime. My user isn't going to page to the last page and then print the
Table of Contents (I can already see it: I'll get a call from her once every
2 weeks saying that she only got a partial table of contents and to fix it).

What VB code do I use and where do I put it (event or module or ?) so that my
report goes to the last page of the report (thereby causing On Print to
trigger and my tblTableOfContents to populate), then back to the first page
of the report so that, from a user's point of view, the first page is
continually presented?

Again, many thanks in advance for any code snippets or suggestions,
ZB
You can use the events of the sections of the report to log the page numbers
to another table, and then print that at the end of the report.
[quoted text clipped - 9 lines]
 
Sorry, hit tab and accidentally posted message...
I found my answer in someone else's posting on Access Monster. I created an
Event Procedure for On Open and put in this code:

SendKeys "{End}"
SendKeys "{Home}"

Works. I can now get my database signed off. Thanks everybody.

\ZB
 
Yes, that's a real trap.

In some reports, even if you jump to the last page, Access does not perform
the events for all the intervening pages.

Without testing, another idea might be to OutputTo to a text file (which
forces Access through all the pages of the report), and then Kill the text
file.
 
Back
Top