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

    Help With Sorting and Grouping? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    I have a Report that print detail lines and provides totals by strRevCode

    Sorting and Grouping
    strRevCode Ascending
    strRefNo Ascending
    strTranDesc Ascending

    <pre>="Summary for " & "'Revenue Code' = " & " " & [strRevCode] & " (" & Count(*) & " "
    & IIf(Count(*)=1,"Detail Record","Detail Records") & ")"
    </pre>


    ------------------------

    In code, how could I use the same Report and change it to the following:

    dtmRevDate Ascending
    strRefNo Ascending
    strTranDesc Ascending

    <pre>="Summary for " & "'Revenue Date' = " & " " & [dtmRevDate] & " (" & Count(*) & " "
    & IIf(Count(*)=1,"Detail Record","Detail Records") & ")"
    </pre>



    My objective is to have one report that can provide multiple Sorting and Groupings

    Thanks. John

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

    Re: Help With Sorting and Grouping? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    You can change the grouping levels in code in the On Open event of the report. You could use a global variable (or your GloGetValue function) to control this.

    Somewhere in your code before opening the report:

    GloSetValue "GroupOn", "dtmRevDate"

    and in the On Open event procedure of the report:

    Private Sub Report_Open(Cancel As Integer)
    If Not GloGetValue("GroupOn") = "" Then
    Me.GroupLevel(0).ControlSource = GloGetValue("GroupOn")
    End If
    End Sub

    GroupLevel(0) is the highest grouping level.

    In the control source of the text box, you would use an extra IIf to test which text should be displayed.

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

    Re: Help With Sorting and Grouping? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    Sweeeeeet!

Posting Permissions

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