Check also group&sort configuration. Or upload your db so I can check it.
Testing_Litigation_DB1.zip
Here you go. Figure this is easier then dealing with my dumb ass..
Thanks again.
Pete
Just change group&sort options, headers will move accordingly.
Well, aren't they on page(s) 1 of relevant reports? It counts pages of each report separately so...
Also, one report has InitToc() function in its Open event, so that one has to be printed first. If you want it to be "Decision released" then move InitToc() to that one and print it first.
Or remove it completely and call it somehow (some button Click event i.e.) before printing any report and then the printing order won't matter.
Even with that change it still puts Awaiting Decisions first even when print previewing Decisions first.
Yeah, I have had to make 3 separate reports that will actually once printed out be one. I am emulating a report we have in word. So it will need to count the pages correctly somehow if possible.
It's because you have ToC report sorted by Title (alphabetically). Maybe try add some numbers to the title parameter? Like "I. Decisions Released", "II. Awaiting Decisions" or whatever suits you.
I guess you could make one master report and place those 3 as subreports? Worth a try but will probably need some changes in code.
Ok will make that change. Never done sub reports but it is worth a try will do some research on it.
Thank you
Here's another idea, can't test it now but you may try this:
1. Make some changes (marked in red) to your module code:
And add this code to OnPrint event of Page Footer of every report (not ToC report):Code:Option Compare Database Option Explicit Dim db As Database Dim toctable As Recordset Public NoOfPages As Integer Function InitToc() Dim qd As QueryDef NoOfPages = 0 Set db = CurrentDb() Set qd = db.CreateQueryDef _ ("", "Delete * From [Table1]") qd.Execute qd.Close Set toctable = db.OpenRecordset("Table1", _ DB_OPEN_TABLE) toctable.Index = "Case_Name" End Function 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] = NoOfPages + 1 toctable!Title = sTitle toctable.Update End If End Function
The rest remains the same: print preview each report, cycle through pages then print ToC report.Code:NoOfPages = Report.Page
If it doesn't work as expected, we'll try fine tune it later