Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2011

    Unanswered: Conditional page break in a report

    Hi all,

    I am trying to add a conditional page break in a report. I would like to force a new page if a check box in the just printed line is checked (true). Having trouble figuring out how to do this, any help would be greatly appreciated.

    The db is used to track the locations and posting dates of signs for outdoor advertising. THis report is based off a query and basically tells the work cr4ews what needs to be done. The query has 3 check boxes, named "Up", "Down", and "rotate", respectively. One and only one of these will always be checked for each line of the report. What I need to do is force a new page if the "Down" box is checked, or continue printing if is is one of the other two.

    Any help greatly appreciated
    Last edited by MacC; 06-01-11 at 15:46.

  2. #2
    Join Date
    Jan 2009
    Kerala, India

    Conditional page break in a report

    I tried a sample Report but not quite successful. Anyway the Code is given below for you to try it out:

    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    If Reports![ReportName]![Down] Then
      Reports![ReportName].Section(acDetail).ForceNewPage = 1
     Reports![ReportName].Section(acDetail).ForceNewPage = 0
    End If
    End Sub (Learn MS-Access Tips & Tricks)
    Learn Advanced MS-Access Programming with sample VBA Code.

    All responses are based on Access 2003/2007

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts