Link to home
Start Free TrialLog in
Avatar of Fritz Paul
Fritz PaulFlag for South Africa

asked on

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.
Why?
Any ideas?
How can I determine what the sort order of the sub-report will be.
Avatar of Dale Fye
Dale Fye
Flag of United States of America image

Because reports are sorted according to the Grouping and Sorting options of the report, not based on the sorting of the query.
Avatar of Fritz Paul

ASKER

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?
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)
boaq2000,
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.


Experts-MeatSCL-Costing-Database.mdb
MeatSCL-Costing-beTesting.mdb
query.JPG
Report.JPG
ASKER CERTIFIED SOLUTION
Avatar of Jeffrey Coachman
Jeffrey Coachman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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, ...post 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.
You are my hero!
Thanks a lot.