Sorting and Grouping Expression

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I was hoping to use an expression in the Sorting and Grouping form for a
Report. I want the User to choose what field to sort the report on in a
form. The expression I've used is:
=Forms!frmProofRptSortOrder!Combo16
Where Combo16 contains a list of field names to sort on. It doesn't appear
to have any effect at all. Any help?

Thanks! Bill
 
Never mind, I got it. I added the following to the OnOpen Event:

Select Case Forms!frmProofRptSortOrder!Combo16
Case "LastName"
Me.GroupLevel(0).ControlSource = "LastName"
Me.GroupLevel(1).ControlSource = "FirstName"
Me.GroupLevel(2).ControlSource = "Phone"
GoTo NormalEnd
Case "DeviceID"
Me.GroupLevel(0).ControlSource = "DeviceID"
Me.GroupLevel(1).ControlSource = "LastName"
Me.GroupLevel(2).ControlSource = "FirstName"
GoTo NormalEnd
Case "CubicleID"
Me.GroupLevel(0).ControlSource = "CubicleID"
Me.GroupLevel(1).ControlSource = "LastName"
Me.GroupLevel(2).ControlSource = "FirstName"
GoTo NormalEnd
Case "Phone"
Me.GroupLevel(0).ControlSource = "Phone"
Me.GroupLevel(1).ControlSource = "LastName"
Me.GroupLevel(2).ControlSource = "FirstName"
GoTo NormalEnd
Case "Phone3000"
Me.GroupLevel(0).ControlSource = "Phone3000"
Me.GroupLevel(1).ControlSource = "LastName"
Me.GroupLevel(2).ControlSource = "FirstName"
GoTo NormalEnd
Case Else
Me.GroupLevel(0).ControlSource = "LastName"
Me.GroupLevel(1).ControlSource = "FirstName"
GoTo NormalEnd
End Select
 
Back
Top