This one has me stumped 🙁
Basically on a multi page invoice it will show a running total on page 1, 2 etc and a Grand Total on the final page. I have easily managed to do this with everything in the Page Footer (Switching txt_boxes.visible etcTrue or False in the PageFooter and GroupFooter Format events) and this is stable for previews as well as printing.
However, the client has asked for the Grand Total to be abutted/adjoined to the detail section which would normally mean puting the Grand Total in the Group (Invoice) Footer.
This is fine until you realise that Access formats the Group Footer before the Page Footer and therefore when there is no room for the Group Footer it throws it to the next page and my code has switched off the Sum Totals. The scenario will occur when you have two full pages of detail, both of which will go down as far as the Page Footer moving the Group Footer to the next page.
If you just try to create a report as I have been tasked please remember I only have a problem with exactly 2,3 etc FULL pages.
I have released my workaround version to the client with a requisite that I clarify whether the format they want is not possible in Access 2000. Additional info follows…
Page Footer 3.5cm
Group Footer 3.5cm
Code on the report with multiple .visibles removed for space…
Option Explicit
Dim PageFlag As Boolean
Private Sub GroupFooter_format(Cancel As Integer, FormatCount As Integer)
PageFlag = False
With Me.PF_AMOUNT.Visible = False
.UD_INVOICE_TOTAL.Visible = True
End With
End Sub
Private Sub GroupHeader0_format(Cancel As Integer, FormatCount As Integer)
PageFlag = True
End Sub
Private Sub PageFooterSection_format(Cancel As Integer, FormatCount As Integer)
If PageFlag = True Then
With Me
.PF_AMOUNT = Me.AmountRunningTotal
.PF_AMOUNT.Visible = TrueEnd
End If
End Sub