Originally posted by NeoPa
Code:
Private Sub Report_Open(Cancel As Integer)
'changes sort order on report by changing control source for sorting/grouping
Select Case Forms!frmAgedNotices.fraSort
Case 1
With Me.GroupLevel(1)
.ControlSource = "Age"
.SortOrder = True
End With
With Me.GroupLevel(2)
.ControlSource = "SourceID"
.SortOrder = False
End With
Case 2
With Me.GroupLevel(1)
.ControlSource = "SourceID"
.SortOrder = False
End With
With Me.GroupLevel(2)
.ControlSource = "Age"
.SortOrder = True
End With
End Select
End Sub
I don't understand where Me.GroupLevel(0 ) went. Possibly it's in use for a higher level sort order. Possibly it doesn't actually matter that the first one is unused when working from code.
Thanks,
martin
Comment