Originally Posted by
pharrison74
Unfortunately this report is for the big wigs upstairs and they are picky lol.
Yeah, they always are
Anyway, it was quite easy to adapt it to your needs. Steps are as follow:
1. Add another field to your "Table of Contents" table:
Code:
Field name: Title
Data type: Text
2. In design view of "Table of Contents" report add grouping section by "Title"
3. Change UpdateToc() function code adding following:
Code:
Function UpdateToc(tocentry As String, Rpt As Report, sTitle As String)
toctable.Seek "=", tocentry
If toctable.NoMatch Then
toctable.AddNew
toctable!Case_Name = tocentry
toctable![page number] = Rpt.Page
toctable!Title = sTitle
toctable.Update
End If
End Function
4. In design mode of reports that you want to include in ToC change OnPrint property of group headers respectively to:
Code:
=UpdateToc([Case_Name],[Report],"Awaiting decision/sentencing/appeal")
or
Code:
=UpdateToc([Case_Name],[Report],"Ongoing cases")
depending on which report it is of course.
And basically that's it, print preview all reports, remember that you need to cycle through all pages of them to update ToC table correctly, then Print Toc report. Done.