Unanswered: Cleaner way to order report with grouping levels?
I have a report that I need to dynamically order according to user input. Normally this can be done using an order by clause. However, since I have defined grouping levels in the report, the order by clause is over-ridden.
To get around this, I have created another grouping level that I set dynamically from code similar to this in the On Open event for the report:
If something = "Something" Then
Me.GroupLevel(0).ControlSource = "fldSomething"
Unfortunately, I'm now in a situation where I need to add another grouping level. I CAN do this using the same method, but it seems awfully messy.
So, is there a better way to dynamically order a report that has grouping levels?
I personally don't see that as messy - it's taking full advantage of the flexibility of Object based programming.
Grouping is in effect Sorting. If you took the days of a standard calendar and sorted by day, you would get 12 "1's", then 12 "2's" etc. If you group by Month, you get the correct sequence because grouping first sorts by Month then by Day.