Results 1 to 6 of 6
  1. #1
    britney is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2019
    Posts
    10

    Alphabetize the order of options in a list combo box

    With help from this forum,I finally got my form bound to a table, and created a combo box with a list of options, in this case they are department names. It works great, and when I select off of the list, it populates the form fields below with their relevant data.



    The issue I have now is that my list has hundreds of options, and they are not alphabetized. In my table, I have it set to sort alphabetically by that field. What can I do to alphabetize the list in the form also?

    Searching around I have found some websites with direction, including using OrderBy to set the order, but I think I may need more exact direction - where would I put that within the database?

  2. #2
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,413
    Add the ORDER BY clause to the combobox rowsource.

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    What is the Row SOURCE of your combobox?
    Try making it a query with an Order By on the department names.

  4. #4
    britney is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2019
    Posts
    10
    Thanks for your reply, Orange! I couldn't figure out the Order By, but was successful with the Sort Ascending function here.

    I used the steps detailed here in an old thread on another site-
    https://access-programmers.co.uk/for...d.php?t=240666

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726

  6. #6
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,803
    I couldn't figure out the Order By, but was successful with the Sort Ascending function here.
    FYI - open the query in sql view and you will see those words. Using the query design interface you'd select Sort Ascending/Descending, but the sql syntax doesn't use "ascending" or "sort".
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 01-12-2019, 05:44 PM
  2. Replies: 3
    Last Post: 09-09-2018, 12:45 PM
  3. Replies: 2
    Last Post: 03-07-2016, 05:02 PM
  4. Replies: 8
    Last Post: 09-03-2015, 08:16 PM
  5. Replies: 3
    Last Post: 08-12-2014, 02:12 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums