Programatically delete report group levels

  • Thread starter Thread starter ExcelMan
  • Start date Start date
E

ExcelMan

I am creating an application with reports that have both default sorting and
the option for the user to customize the report sort order to 3 levels.
Sometimes though the user only selects a single sort level, but the default
sort level may have been more than one. So I need to delete the 2 - n sort
levels the user chose not to use.

As you might guess, I implement the custom sort in the report_open event.
Is there a way for me to delete an unneeded group level? I tried setting
the ControlSource = "", but it didn't like that.

I can't seem to find a GroupLevel(n).Delete method? Any ideas?

Thanks.
 
ExcelMan said:
I am creating an application with reports that have both default sorting and
the option for the user to customize the report sort order to 3 levels.
Sometimes though the user only selects a single sort level, but the default
sort level may have been more than one. So I need to delete the 2 - n sort
levels the user chose not to use.

As you might guess, I implement the custom sort in the report_open event.
Is there a way for me to delete an unneeded group level? I tried setting
the ControlSource = "", but it didn't like that.

I can't seem to find a GroupLevel(n).Delete method? Any ideas?


Right, there is no method to delete a GroupLevel.
Inconsistent, but there it is.

You were close in trying to set the ControlSource to
something, but you need to use an expression with a constant
value. E.g.
Me.GroupLevel(n).ControlSource = "=1"
 
Back
Top