Results 1 to 6 of 6
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Report Breaks To New Page If? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    I have the attached report that prints a list of parcels in street sequence and breaks on street name with a total number of parcels, then continues with the next street.

    I want to add code to the Open Event that will ask the operator to print report as described above or to break to a new page when the street name changes.

    Any suggested code would be helpful.

    Thanks, John
    Attached Files Attached Files

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Report Breaks To New Page If? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    1) Set the Group Header property of strLocStreetName in the Sorting and Grouping window to Yes.
    2) Set the Height property of the new group header to 0.
    3) Add the following lines to the On Open event procedure of the report:

    If MsgBox("New page for each street?", vbQuestion + vbYesNo) = vbYes Then
    Me.GroupHeader0.ForceNewPage = 1
    Else
    Me.GroupHeader0.ForceNewPage = 0
    End If

    where GroupHeader0 is the name of the group header.

  3. #3
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Report Breaks To New Page If? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    That works Great!

    I added Me.ReportFooter.ForceNewPage = 1 to get the totals on a seperate page

    Attached is final example db that may help someone else

    Thanks, John
    Attached Files Attached Files

  4. #4
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Report Breaks To New Page If? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    Is there any way with code in Report Open Event to disable or change Sorting and Grouping Field/Expression and Sort Order values?

    John

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Report Breaks To New Page If? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    You cannot add or remove grouping/sorting levels in the On Open event, but you can change existing ones using the GroupLevel array. The first grouping/sorting level is GroupLevel(0), etc.

    Example:

    With Me.GroupLevel(0)
    .ControlSource = "strLocStreetNo"
    .SortOrder = True ' i.e. descending
    End With

  6. #6
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Report Breaks To New Page If? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    I added the following, now I can maintain 1 report and print in many different sequences, with or without group totals

    Thanks for your help

    John

    'report by Owner Name, Swis, SBL Number, Property Class, Roll Section
    'don't show group heaser
    Me.GroupHeader0.Visible = False
    'no page break
    Me.GroupHeader0.ForceNewPage = 0
    'don't group totals
    Me.GroupFooter2.Visible = False
    'show report totals
    Me.ReportFooter.Visible = True

Posting Permissions

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