Results 1 to 2 of 2
  1. #1
    Join Date
    May 2002

    Unanswered: Printing Subreports with blank line every 5th.

    I am printing a main report in Access 97 (a member sign-in sheet) with two subreports containing member names: one sub with active members and one with inactive members. I have coded each subreport to print a blank line after every 5th line (see code below) , which it does nicely when I preview the subs individually. Both subreports are in the detail section of the main.

    When I print the main report, both sub's print fewer than 5 lines, then a blank line, then they work correctly printing a blank line after every 5th.

    What am I doing wrong that causes the subs to NOT print in the main report the way they do in the subreports?

    The code is from MS Access Support doc Q139046.

    Option Compare Database
    ' This code declares the cLines variable as an integer, and the
    ' cMaxLine constant as five. You can set the cMaxLine constant
    ' to insert a blank line after as many lines as you want. For ' example, to add a blank line after every eight lines in the
    ' report, set cMaxLine=8.

    Dim cLines As Integer
    Const cMaxLine = 5

    Private Sub Report_Open(Cancel As Integer)
    ' This code initializes the cLines variable to zero.
    cLines = 0
    End Sub

    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    ' This code adds a blank line by setting the NextRecord and
    ' PrintSection properties.

    If cLines Mod (cMaxLine + 1) = 0 Then
    Me.NextRecord = False
    Me.PrintSection = False
    End If

    cLines = cLines + 1

    End Sub



  2. #2
    Join Date
    Feb 2002
    If it is any concellation I do not think Access 97 cab count. Queries I set up 97 based on top 5 and similar return somewhere from 4 to 17 records. In 2000 and above this problem goes away.

Posting Permissions

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