Ok, I just don't get how this works....
I have a form called frmOptions that allows the uer to select (among other things) the sort order. If they select sort A from the combobox, the report should be sorted by Seg1, Seg2, Obj, Seg4, Seg5. Sort B would be Seg1, seg3, seg2, obj, seg4. WHen the report opens using sort A, I want it sorted, and then group headings for Seg2, a group footer for obj, and a group footer for seg2. When the report opens for sort B, I want it sorted, and then group headings for seg3, group footer for obj, group footer for seg3.
In the report, I used the 'sorting and grouping' button to put in group headings/footers for each of the sort items.
In the on open event of the report, I have the following...
Select Case Forms!frmOptions!cboSort
Case "A"
Me.GroupLevel(0).ControlSource = "glma_seg1"
Me.GroupLevel(1).ControlSource = "glma_seg2"
Me.GroupLevel(2).ControlSource = "glma_obj"
Me.GroupLevel(3).ControlSource = "glma_seg4"
Me.GroupLevel(4).ControlSource = "glma_seg5"
Case "B"
Me.GroupLevel(0).ControlSource = "glma_seg1"
Me.GroupLevel(1).ControlSource = "glma_seg3"
Me.GroupLevel(2).ControlSource = "glma_seg2"
Me.GroupLevel(3).ControlSource = "glma_obj"
Me.GroupLevel(4).ControlSource = "glma_seg4"
End Select
End Sub
I guess the problem is that I really don't fully understand how this whole thing works. Can some kind soul explain to me in SIMPLE english how this works, if I can do what I want to, and where I went wrong?
At this point, when I open the report I am not getting all of the data, and I can tell that the sorting/grouping isn't working properly.
Any assistance would be greatly appreciated.
I have a form called frmOptions that allows the uer to select (among other things) the sort order. If they select sort A from the combobox, the report should be sorted by Seg1, Seg2, Obj, Seg4, Seg5. Sort B would be Seg1, seg3, seg2, obj, seg4. WHen the report opens using sort A, I want it sorted, and then group headings for Seg2, a group footer for obj, and a group footer for seg2. When the report opens for sort B, I want it sorted, and then group headings for seg3, group footer for obj, group footer for seg3.
In the report, I used the 'sorting and grouping' button to put in group headings/footers for each of the sort items.
In the on open event of the report, I have the following...
Select Case Forms!frmOptions!cboSort
Case "A"
Me.GroupLevel(0).ControlSource = "glma_seg1"
Me.GroupLevel(1).ControlSource = "glma_seg2"
Me.GroupLevel(2).ControlSource = "glma_obj"
Me.GroupLevel(3).ControlSource = "glma_seg4"
Me.GroupLevel(4).ControlSource = "glma_seg5"
Case "B"
Me.GroupLevel(0).ControlSource = "glma_seg1"
Me.GroupLevel(1).ControlSource = "glma_seg3"
Me.GroupLevel(2).ControlSource = "glma_seg2"
Me.GroupLevel(3).ControlSource = "glma_obj"
Me.GroupLevel(4).ControlSource = "glma_seg4"
End Select
End Sub
I guess the problem is that I really don't fully understand how this whole thing works. Can some kind soul explain to me in SIMPLE english how this works, if I can do what I want to, and where I went wrong?
At this point, when I open the report I am not getting all of the data, and I can tell that the sorting/grouping isn't working properly.
Any assistance would be greatly appreciated.