Sort lines in an MS Access sub-report

I defined a query, sorted in ascending certain order.
I build a sub-report based on this query alone.
The sub-report is not sorted in the same order as the query.
Any ideas?
How can I determine what the sort order of the sub-report will be.
Fritz PaulAsked:
Who is Participating?
Jeffrey CoachmanMIS LiasonCommented:
So is your ultimate question here how to sort the Total Cost Column in Descending order (Highest to the lowest)?

If so then:
1. Make the source for that Total Cost control the query field "Total Cost" (Not a calculated field)
2. Use the Sorting/Grouping options to set a sort of "Total Cost" Descending

The Modified FE is attached.
You will have to relink the BE table to your original path to the BE

Dale FyeCommented:
Because reports are sorted according to the Grouping and Sorting options of the report, not based on the sorting of the query.
Fritz PaulAuthor Commented:
I hear you. Thanks.
I have now set the sub-report's Order By, When I open the sub-report alone, the sort sequence is now the same as that of the query,(because I set it up like that), but in the main report, it is still sorted the other way round.
How can I force the sub-report to sort in a given order when it opens in the main report?
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Jeffrey CoachmanMIS LiasonCommented:
It is not clear if: "a given order" means: "the same order as the main form"

It also sound like this report can be used as both a main report and a sub report....?

...So can you first take a step back and explain a bit more about this/these Reports, (their design and purpose)
Fritz PaulAuthor Commented:
Accept my apologies that I was not aware that you gave a comment to my question.

The problem is:

The subreport contains a list of detail ingredients of a recipe. The query of the subreport lists the ingredients in reverse order, from large to small. The subreport can be opened on it's own, showing all ingredients to all recipes, and has the same order as the query, i.e. high to low.
The subreport is included in the main report, with a  parent child relationship on the subreport query index, while the main report filters only the main report recipe index.
The problem now is that the ingredients on the subreport is now reversed and I can not see why.

The database is attached. The report to open is RPTRECIPE with
Forms!frmRecipeSelect!RecipeFor = 3.

Jeffrey CoachmanMIS LiasonCommented:
Just FYI:

Sample database notes:
1. Back up your database(s).
2. Combine the front and back ends into one database file.
3. Remove any startup options, unless they are relevant to the issue.
4. Remove any records unless they are relevant to the issue.
5. Delete any objects that do not relate directly to the issue.
6. Remove any references to any "linked" files (files outside of the database, Images, OLE Files, ...etc)
7. Remove any references to any third party Active-x Controls (unless they are relevant to the issue)
8. Remove, obfuscate, encrypt, or otherwise disguise, any sensitive data.
9. Compile the code. (From the VBA code window, click: Debug-->Compile)
10. Run the compact/Repair utility.
11. Remove any Passwords and/or security.
12. If a form is involved in the issue, set the Modal and Popup properties to: No
    (Again, unless these properties are associated with the issue)
13. Post the explicit steps to replicate the issue.
14. Test the database before posting.

In other words, a database that we can easily open and immediately see and/or troubleshoot the issue.
And if applicable, also include a clear graphical representation of the *Exact* results you are expecting, based on the sample data.
Fritz PaulAuthor Commented:
You are my hero!
Thanks a lot.
Jeffrey CoachmanMIS LiasonCommented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.