Okay. I'll admit that I feel a little stupid after reading the help on CreateGroupLevel, GroupOn, etc, playing around with it, and I'm still not able to get it to work.
Basically, what I want to do is have a form that allows the user the option of picking which counties to include the report (which is grouped by counties). That's no problem. But I ALSO want the option of not grouping by counties at all. My guess is to include some code in the Report_Open method that would either (a) add a grouping level if conditions on the form were met or (b) remove a grouping level if conditions on the form were not met. How do I do this?
As I write, it occurs to me that a reasonable alternative may be to provide totals at the bottom of the grouped report. The problem with this is that what I want would be sums for the details, not the groups. Let's say that my detail field is Service. It just so happens that the services pulled in by this query happen to be Service=Food and Service=Clothing, let's say. I don't want a total for the Service field, that would mash all the detail into a useless lump; I'd want the report to automatically have a sum for every distinct type of detail record, if that makes any sense.
Basically, what I want to do is have a form that allows the user the option of picking which counties to include the report (which is grouped by counties). That's no problem. But I ALSO want the option of not grouping by counties at all. My guess is to include some code in the Report_Open method that would either (a) add a grouping level if conditions on the form were met or (b) remove a grouping level if conditions on the form were not met. How do I do this?
As I write, it occurs to me that a reasonable alternative may be to provide totals at the bottom of the grouped report. The problem with this is that what I want would be sums for the details, not the groups. Let's say that my detail field is Service. It just so happens that the services pulled in by this query happen to be Service=Food and Service=Clothing, let's say. I don't want a total for the Service field, that would mash all the detail into a useless lump; I'd want the report to automatically have a sum for every distinct type of detail record, if that makes any sense.