Sorting

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?
 
A

Allen Browne

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top