How a report is sorted is specified in the report's Sorting
and Grouping window (View menu). First specify the sorting
for a field to create the sort level. Then you can use code
in the report's Open event to change it to the user's
specified field:
If Not IsNull(Froms!theform.cbofields) Then
Me.GroupLevel(0).ControlSource = Froms!theform.cbofields
End If
If the report has grouping specified, change the 0 to the
appropriate index.
Be sure to check Help for details on the GroupLevel
property.