sorting in a report

  • Thread starter Thread starter Sean G.
  • Start date Start date
S

Sean G.

Hello, I would like to be able to sort my report by a
field other than the ones in my "sorting and grouping"
section. There I would like to group by those but not
sort. any ideas?


-Sean
 
Sean said:
Hello, I would like to be able to sort my report by a
field other than the ones in my "sorting and grouping"
section. There I would like to group by those but not
sort. any ideas?


-Sean

Does it sort properly for you if you add the field to the Sorting and
Grouping dialog, but move it to the top of the list before the other
fields.
 
Yes, that would work but I want a box to pop up and ask
the user how they would like to sort, I can't depend on
that "sorting and grouping", thanks.
 
Sean said:
Hello, I would like to be able to sort my report by a
field other than the ones in my "sorting and grouping"
section. There I would like to group by those but not
sort. any ideas?


Grouping, by its very nature imposes a sort order. If you
want to sort by another field, then you must add that field
to the Sorting and Grouping list (it sound slike you want it
before the entries that have a group header/footer).

You can change the field that is used to sort by setting
properties of the appropriate GroupLevel in the report's
Open event procedure:

Me.GroupLevel(N).ControlSource = "somefieldname"

And you can effectively neutralize an existing group or sort
level by setting its control source to a constant
expression:

Me.GroupLevel(N).ControlSource = "=1"
 
Hi - I read this thread and tried this suggestion.
Setting the grouplevel(N).ControlSource = "=1" does not
seem to work in the onopen event for a subreport to
neutralize the sorting order. Right now, I have a
subreport with group level (1) and group level (2) (with
grouplevel(0) as a dummy group, used in the header), and
when I set the group level(1) = "=1" (trying to
neutralize it), it still sorts by the group level(1).

Any suggestions?
 
phil said:
Hi - I read this thread and tried this suggestion.
Setting the grouplevel(N).ControlSource = "=1" does not
seem to work in the onopen event for a subreport to
neutralize the sorting order. Right now, I have a
subreport with group level (1) and group level (2) (with
grouplevel(0) as a dummy group, used in the header), and
when I set the group level(1) = "=1" (trying to
neutralize it), it still sorts by the group level(1).


Gee Phil, we're having a bad day. I can't get this one to
fail either.

Are you sure that what you're getting isn't the same oreder
as you'd get if you eliminated that sorting level?
 
Back
Top