Results 1 to 5 of 5
  1. #1
    HansBades is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Dec 2021
    Posts
    85

    sort list box

    I have a list box on a form with values. The user can add another value to the listbox through the form using a text box. It adds the new value but it adds it at the bottom of the list. I want it to sort alphabetically after it adds the new value. What is the best way to do that? Thank you!

  2. #2
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    are the underlying values in the list box in a table? If so, you can sort the values in the table.

  3. #3
    ssanfu is offline Master of Nothing
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    In my combo boxes and list boxes I use a query. Using a query for the Row Source allows you to select which field to sort by and the sort direction - Asc or Desc.
    I never use a table as the Row Source; always a query.

  4. #4
    HansBades is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Dec 2021
    Posts
    85
    How do I sort the table using code? thanks

  5. #5
    HansBades is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Dec 2021
    Posts
    85
    I changed it to a query and sorted it that way. Much easier. Thank you both!

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

Similar Threads

  1. List Box number sort
    By JimO in forum Access
    Replies: 3
    Last Post: 12-10-2017, 02:22 PM
  2. Replies: 4
    Last Post: 10-03-2015, 01:22 AM
  3. Does anyone know how to sort the field list?
    By tstoneami in forum Access
    Replies: 4
    Last Post: 08-08-2013, 12:32 PM
  4. Report sort order from list field
    By john3588 in forum Reports
    Replies: 3
    Last Post: 03-01-2013, 02:41 PM
  5. Creating Sort Buttons in a Header in a list view
    By marttaaayyy!! in forum Programming
    Replies: 4
    Last Post: 03-29-2010, 11:08 AM

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