Hello
I have got a report, which can run on 3 groups of data:
College
Faculty
School
Faculty contains schools. College contains faculties.
The report can be run for college, then it includes several faculties
and requires report footer, where totals for college are calculated.
The report also can be run for a faculty. Then it includes several
schools and requires faculty group footer, where totals for faculty are
calculated, but it doesn't need report footer any more.
The report also can be run for a school. in this case, it doesn't need
report footer and faculty group footer.
I have managed to get reed of footers. To do so, I run running sums
"Total Schools" in the school group footer and "Total Groups" in the
faculty group footer. Then the following code switches off printing of
unnecessary footer(s):
Private Sub GroupFooter5_Format(Cancel As Integer, FormatCount As
Integer)
If Me![Total Schools] <= 1 Then
Cancel = 1
End If
End Sub
Private Sub ReportFooter4_Format(Cancel As Integer, FormatCount As
Integer)
If Me![Total Groups] <= 1 Then
Cancel = 1
End If
End Sub
The problem is that when I run the report for 1 school only, page
header still prints on a page, where faculty footer would have been
printed.
When I run the report for 1 faculty, the report footer doesn't print,
but an empty page does.
How can I get rid of unnecessary pages altogether?
Thank you.
Galina