Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Option Compare Database
Option Explicit
' The code on this report is all to do with ensuring that the 'Page Header'
' is printed when a Block's data continues from one page to another
' but does not print when a new Block's data starts at the top of a page.
' mblnEnableHeaderFormat is needed because near the end of a page
' if the Block's section Header could just fit on the page but the rest
' of the data does not, the sequence of events is
' Header_Format
' Header_Retreat
' Header_Format ( BUT Format count is still 1 !!! )
' Print New Page
' So the Header_Retreat needs to prevent the next Header_Format from allowing
' the continuation header to be displayed.
' PageHeader_Format then resets this prevention after the first page in the section
Dim mblnHidePageHeader As Boolean
Dim mblnEnableHeaderFormat As Boolean
Private Sub BlockHeader_Format(Cancel As Integer, FormatCount As Integer)
If mblnEnableHeaderFormat Then
mblnHidePageHeader = False
End If
End Sub
Private Sub BlockHeader_Retreat()
mblnHidePageHeader = True
mblnEnableHeaderFormat = False ' Prevent Header_Format from setting HPH to False
End Sub
Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As Integer)
Cancel = mblnHidePageHeader ' THE line that actually does the Show/NotShow work
mblnEnableHeaderFormat = True ' Reset after first page of any section
End Sub
Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer)
'Initialisation
mblnHidePageHeader = True
mblnEnableHeaderFormat = True
End Sub