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

Report Table of Contents

Status
Not open for further replies.

mmogul

IS-IT--Management
Dec 1, 2003
218
US
I am trying to create a table of contents for a report. I am using the basic procedure shown in this link: .

This basically has you update another table using the OnPrint event whenever the GroupHeader changes.

My problem is that this table does not get updated on a print preview unless the user scans through the entire report or prints the report. What I would really like to do is run through the report one time, create the TOC table, then print the TOC and then immediately follow it with the report.

Any suggestions?

Thanks.
 
Hi, mmogul,

What happens if you use the OnFormat event instead of the OnPrint event? Just an idea...


Ken S.
 
Ken,

That worked. Thanks.

Any thoughts how the report can be run but not printed or previewed so the table of contents table is created. This would allow the TOC to print first before the report.

Mark
 
Hi, Mark,

I didn't spend a lot of time on the link you posted, but it seems the report *has* to run in order to generate the TOC. But... nobody says the report has to be seen before the TOC is generated. Take a look at the WindowMode argument of the OpenReport method.

HTH,

Ken S.
 
Ken,

That's what I was looking for. This should work. Thanks!!

Mark
 
I am attempting to use the same procedure as mmogul. As well as the on-print condition, the MS procedure requires =InitToc() as an on-open conditin. I already have InitVars() as an on-open condition. How do I have both? E.g Do I simply cut-and paste from InitToc() into InitVars()?

RodH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top