Sorting on Report

Posted on 2011-10-14
Last Modified: 2013-11-05
I have a query that is the datasource for a report.  When I run the query and look at the data the criteria to sort by Payment (descending).  When I run the report, it's sorted alphabetically by person's last name and doesn't sort by Payment.  See screenshots.  

The button that calls the report is very simple:

    Dim stDocName As String

    stDocName = "rptRegistration"
    DoCmd.OpenReport stDocName, acPreview

I also checked to make sure the Report doesn't have code on the OnLoad that would sort.

Where else could I look to find filters that would be overiding my report sort order?

Question by:gcgcit
    LVL 61

    Expert Comment

    Reports have a seperate Sorting and Grouping feature that may appear to override the ordering in your query.

    I would check there...
    LVL 61

    Accepted Solution

    You can get to that feature by right-clicking the little grey square in the upper left hand corner of your report in design view, and selecting 'Sorting and Grouping'.

    Author Closing Comment

    You're a genius thanks... that's exactly where it was.  The person who originally made the report sorted by last name in there!
    LVL 56

    Expert Comment

    by:Jim Dettman (Microsoft MVP/ EE MVE)

     Just as an add on comment, reports by design ignore any sorting in the data they are based on as they need to control that in order to do things like group levels and totaling.

      They could not provide those features if they relied on the underlying datasource to do the sorting.


    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
    I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
    In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now