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

Dealing with headers for report that is Standalone and Sub-report

Status
Not open for further replies.

mystuff

Programmer
Apr 30, 2004
86
US
I have a report that can be printed both as a stand-alone report, or as a subreport in another report.

I want the Report headers/footers and page headers/footers to print when it is being run by itself (standalone), but I don't want these headers to print when it is a subreport. How can I do this?

Thanks.
 
No page sections or events or controls will display when the report is used as a subreport. If you want to hide a report header of a report only when used as a subreport, you can use code like:
Code:
Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer)
    On Error Resume Next
    Cancel = Me.Parent.Name & "" > ""
End Sub

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top