Sorting

  • Thread starter Thread starter st3ff
  • Start date Start date
S

st3ff

In a report, I have a total of a grouped field of four records, I would like
to sort these groups by the calculated field in the group footer while
keeping all four records in the group together.

How can I do this?
 
You cannot sort by a calculated total: Access doesn't have the total until
after it has put the groups on the page, and then it's to late to rearrange
them into a different order.

To sort on the total, you will need to get the total into the RecordSource.
One way to do this would be to create another query that groups by the key
field and gives the total, and use that saved query as an input "table" for
your main query.

Another way would be to use a DSum() to get the total.

Yet another would to use a Total query for the main report (so you have the
totals and can sort), and put the detail records in a subreport.
 
Back
Top