Going Insane ! Forcing page breaks on Invoice report

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mikeDA
    New Member
    • Apr 2007
    • 2

    Going Insane ! Forcing page breaks on Invoice report

    I have an invoice report in Access. I have three invoices. I want to force a page break after each invoice# so I end up with three invoices, each with a header (invoice# date etc.), detail (items purchased, cost, extension etc) and a footer (totals, amount due etc.). I can't for the life of me do this after spending a morning trying to use the force page break proprty setting.

    My invoice design has a report header (invoice# etc.), page header (where the column names are specified), detail (items, costs), page footer (empty) and a report footer (totals).

    Can someone help me before I go insane?!!!
  • Corster
    New Member
    • Mar 2007
    • 36

    #2
    In your group properties, (Right-click your group header section) change "Keep Together" to "Whole Group". This means if a group begins after the first line on a page, it will start on the next page..
    Change the "Force New Page property of your group to "Before Section". This will ensure that no two groups are on the same page.
    Last edited by Corster; Apr 20 '07, 04:13 PM. Reason: Incorrect advice given

    Comment

    • MMcCarthy
      Recognized Expert MVP
      • Aug 2006
      • 14387

      #3
      Originally posted by Corster
      In your group properties, (Right-click your group header section) change "Keep Together" to "Whole Group". This means if a group begins after the first line on a page, it will start on the next page..
      Change the "Force New Page property of your group to "Before Section". This will ensure that no two groups are on the same page.
      Alternatively set the Force New Page to "After Section" and put it on the Footer.

      Comment

      • amstony
        New Member
        • Mar 2012
        • 1

        #4
        I hope this helps others with similar problems.
        I spent days trying to work out how to trigger page breaks in the Report Footer section of a report. My Report Footer needed to contain a number of sections which all needed to start on a new page if present. After much Google research I eventually worked out a solution. As follows.
        In report design view I included all the page breaks I needed in the Report Footer section of my report. Each (named) page break was at the end of each (named) section (fields or subforms). In the ON FORMAT event for the Report Footer I included the following code which conditionally turned on (made visible) the page breaks. The code is below which can be simplified or expanded dependant on how many conditional page breaks are required.
        Code:
        Private Sub ReportFooter_Format(Cancel As Integer, FormatCount As Integer)
        On Error GoTo Err_ReportFooter_Format
        
        'Conditionally show report footer page breaks
        
        'Set all page breaks in Report Footer section to be NOT visible
          Me.PageBreakDisclaimer.Visible = False 'Disclaimer section
          Me.PageBreakCheckInStatement.Visible = False 'Check In Statement section
          Me.PageBreakCheckOutStatement.Visible = False 'Check Out Statement Section
          Me.PageBreakCheckInComment1.Visible = False 'Check In Comment1 section
          Me.PageBreakCheckInComment2.Visible = False 'Check In Comment2 section
          Me.PageBreakCheckOutComment1.Visible = False 'Check Out Comment1 section
          Me.PageBreakCheckOutComment2.Visible = False 'Check Out Comment2 section
        
        'Set Disclaimer Page Break condition
            If Len(Nz([txtFormal] & [txtFormal] & [txtDisclaimerHeading] & [txtDisclaimer] & _
            [txtCopyrightHeading] & [txtCopyright] & [txtAuthorisedUsageHeading] & _
            [txtAuthorisedUsage] & [txtContactHeading] & [txtContact], "")) = 0 Then
            Me.PageBreakDisclaimer.Visible = False
           Else
            Me.PageBreakDisclaimer.Visible = True
           End If
        
           'Set Check In Statement Page Break condition
           If Len(Nz(CheckInStatement![txtCheckInStatementHeading] & CheckInStatement![txtCheckInStatement], "")) = 0 Then
            Me.PageBreakCheckInStatement.Visible = False
           Else
            Me.PageBreakCheckInStatement.Visible = True
           End If
        
            'Set Check Out Statement Page Break condition
           If Len(Nz(CheckOutStatement![txtCheckOutStatementHeading] & CheckOutStatement![txtCheckOutStatement], "")) = 0 Then
            Me.PageBreakCheckOutStatement.Visible = False
           Else
            Me.PageBreakCheckOutStatement.Visible = True
           End If
        
            'Set Check In Comment1 Page Break condition
           If Len(Nz(CheckInComment1![txtCheckInCommentHeading1] & CheckInComment1![txtCheckInComment1], "")) = 0 Then
            Me.PageBreakCheckInComment1.Visible = False
           Else
            Me.PageBreakCheckInComment1.Visible = True
           End If
        
           'Set Check In Comment2 Page Break condition.
           'Note. This uses the same criteria as Check In Comment1 above
           If Len(Nz(CheckInComment1![txtCheckInCommentHeading1] & CheckInComment1![txtCheckInComment1], "")) = 0 Then
            Me.PageBreakCheckInComment2.Visible = False
           Else
            Me.PageBreakCheckInComment2.Visible = True
           End If
        
            'Set Check Out Comment1 Page Break condition
           If Len(Nz(CheckOutComment1![txtCheckOutCommentHeading1] & CheckOutComment1![txtCheckOutComment1], "")) = 0 Then
            Me.PageBreakCheckOutComment1.Visible = False
           Else
            Me.PageBreakCheckOutComment1.Visible = True
           End If
        
           'Set Check Out Comment2 Page Break condition
           If Len(Nz(CheckOutComment1![txtCheckOutCommentHeading1] & CheckOutComment1![txtCheckOutComment1], "")) = 0 Then
            Me.PageBreakCheckOutComment2.Visible = False
           Else
            Me.PageBreakCheckOutComment2.Visible = True
           End If
        
        Exit_ReportFooter_Format:
            Exit Sub
        
        Err_ReportFooter_Format:
            MsgBox Err.Description
            Resume Exit_ReportFooter_Format
        
        End Sub
        Last edited by NeoPa; Mar 10 '12, 03:58 PM. Reason: Added mandatory [CODE] tags for you.

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32633

          #5
          I can't see why a kludgy block of code is required when a far simpler, and much more straightforward , approach is available in post #3.

          Comment

          Working...