>Hello!
>
>I'm trying to create groupings in a report based on what fields a user selects from a picklist. I create a variable that contains the fieldname to be grouped on and I put that variable in my report's "Data Grouping".
>
>My problem is that I can't seem to pass it as a reference. I've tried &gcGroup also (gcGroup) also (&gcGroup) also just plain gcGroup. Nothing works. My conclusion is that I can't use name expressions or macro substitution in a report form. Is this true or am I doing something stupid. If so, does anyone have any other ideas how to set up groupings in a report on the fly?
My old Indian trick is to group on Eval(yourvar). Works happily for years. I have actually built a combination of one moverbox (to pick two or three items to order by, out of four or more), few textboxes to pick the filtering of the data, a combo to pick the report format (like summary / detailed / narrow / verbose) and then I use the filtering to create the Where clause of the SQL Select, mover values to create the Gr1, Gr2, Gr3, Caption1, Caption2, Caption3 for the reports, and to create the Order By clause of the SQL, and then run the report on the selected data. It comes down to at least 24 combinations (disregarding the filter) of ordering and reports - all with just 3 or 6 .frx files. I've noticed I have simply killed the older single-purpose reports and nobody complained.
>AHWBGA!!!
Interesting... we could exchange couple of these, though I'm not sure everyone could grasp the artistic beauty of some local variants. I know I have had some rather aesthetically challenging outbursts myself, which were duly noted in the comments throughout my source.