Solved Report not Opening

The Report shows Sorted by AuthorizationID [The PK] not by AuthorizationDate as it should, I've checked all the code that goes from the form to the report, and as well the Query "qryAuthorizationAllForReport" and I don't see where the sort is changed to the PK instead of the AuthorizationDate, I'm baffled.

True - but that's nothing to do with my changes - this would also have been the case in the original database you uploaded.
By default, reports ignore any sorting in the data source - whether form or query
However they have their own very powerful sorting and grouping feature which is applied in design view.

If this feature isn't used, the report is automatically sorted by the first field - in your case the PK field AuthorizationID
To fix this, open the report in design view, right click and select Sorting and Grouping then enter the required details
I've done this for you in version 4 attached
1767387258383.png


Any additional sorting done in the form is still transferred to the report as it uses the same record source

I've tweaked the SortedBy textbox on the report accordingly

1767387494307.png


Hopefully this now behaves as you want.
 

Attachments

Version 5:
Fixed an issue from version 4 if the end user manually sorted by AuthDateEntered DESC

To do so, I removed the report sort from design view again and reordered the code in Report_Open.
SortedBy textbox control source on report changed back to " = [TempVars]![OrderBy]"

I also added textboxes to show the date range on both form & report. Hopefully I'm done now!
 

Attachments

Last edited:
Version 5:
Fixed an issue from version 4 if the end user manually sorted by AuthDateEntered DESC

To do so, I removed the report sort from design view again and reordered the code in Report_Open.
SortedBy textbox control source on report changed back to " = [TempVars]![OrderBy]"

I also added textboxes to show the date range on both form & report. Hopefully I'm done now!
I'm grateful with your help.
I have no idea that reports do their own thing, that's very new to me.
Also I went to see your example as you told me, the way you handle the sort is simply really good, I am planning to make some strategic changes to the form (where the report is created) and apply some of those sorts to my form, of course this will be mostly for my own knowledge and practice, and IF I make it work, probably will push it to production.

Again thank you for your patience and assistance.
Maurice.
 

Users who are viewing this thread

Back
Top Bottom