ORDER BY clause for Forms

Posted on 2009-05-01
Last Modified: 2013-12-12

I created a form using the wizard and I believe it's based on one the queries I created. I can't really recall as I'm just learning access. In the query I added an ORDER BY clause and it displays properly in the proper order;however, the form does not conform with the ORDER BY clause of the query. How can I edit the form to use this ORDER BY clause?

SELECT articles.*, articleDirectory.*, clients.*, many.*, articleBody.*
FROM (clients INNER JOIN (articles INNER JOIN (articleDirectory INNER JOIN many ON articleDirectory.articleDirectoryID=many.articleDirectoryID) ON articles.articleID=many.articleID) ON clients.clientID=many.clientID) INNER JOIN articleBody ON many.articleBodyID=articleBody.articleBodyID

I find ms access does not seem to conform to the SQL standards - so many brackets and kind of confusing when one looks at the statement. Just a thought on it.
Question by:Victor Kimura
    LVL 77

    Accepted Solution

    If your form sort order does not match the recordsource sort order, it suggests that at some point you have sorted the form data into a different sequence and then saved the form.
    If you look at the form properties this should be visible in the form's Order By property.  Delete anything in that property and you should be back to the recordsource order.
    LVL 19

    Expert Comment

    Goto your form properties
    under the order by property you can define your primary sort


    Author Comment

    by:Victor Kimura
    Hi peter57,

    I see the OrderBy in the Form's property. It's just blank. Is there supposed to be a drop-down menu to select different fields to sort by?
    LVL 19

    Expert Comment

    No. Actually all you need to do is specify the field name there
    LVL 19

    Assisted Solution

    You can also specify the order direction as well
    ContactName DESC

    If you have more than one field you can seperate them by comma:
    Name ASC, Amount DESC


    Author Closing Comment

    by:Victor Kimura
    Thank you, peter57r. Thank you, NerdsOfTech.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Suggested Solutions

    Title # Comments Views Activity
    using Access 8 35
    Use a Where Clause in a Foreach loop 14 33
    Day count current month 3 23
    GPS save in database 19 19
    I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
    Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
    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…
    The viewer will learn how to dynamically set the form action using jQuery.

    794 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

    17 Experts available now in Live!

    Get 1:1 Help Now