Let the user chose the report grouping

DBL

Registered User.
Local time
Today, 20:59
Joined
Feb 20, 2002
Messages
659
I have an accounts report which runs throughout the year. I'd like to be able to offer the user the chance to print the report by month, so that it breaks each month on to a new page, or let them run the whole report without the break. Can I use code behind a dialog box/Option Frame to do this? Something on the On Print event of the report I would have thought?

Thanks

Dawn
 
For simply including/excluding the page breaks, you could try something like this in the Report's On Open event:

Code:
Private Sub Report_Open(Cancel As Integer)

    Const cNone As Integer = 0
    Const cBeforeSection As Integer = 1
    Const cAfterSection As Integer = 2
    Const cBeforeAndAfter As Integer = 3

    If MsgBox("Add page break after Grouping?", vbYesNo) = vbYes Then
        Me.GroupFooter0.ForceNewPage = cAfterSection
    Else
        Me.GroupFooter0.ForceNewPage = cNone
    End If

End Sub

If you want to hide the Grouping, you can use the Me.GroupFooter0.Visible property (True/False).
 
Excellent, thank you, that is just what I wanted.
 

Users who are viewing this thread

Back
Top Bottom