Results 1 to 3 of 3
  1. #1
    mightyteegar is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2012
    Posts
    3

    Asc/Desc/reset sort button code

    I have a form whose query pulls the 20 most recently modified records from a table. The form design has column headers at the top and a small set of fields in the form body. By default (on form open) I want to show the form's rows as returned by the query, i.e. sorted by modification date starting with the most recent. All of this is working.



    Now I want to be able to click on the "CustomerName" header at the top and perform a toggle sort *with that exact recordset* by CustomerName, i.e. ascending-descending-reset to default (by mod date), all with the last 20 modified rows. Anyone who uses the Spotify media app will know what I'm describing -- they offer the exact same sorting mechanism for song search results.

    I have no idea how to go about this as my programming skills are improving but still very basic. Can someone help?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,945
    One way may be using code to set the OrderBy property of form. I never have used this, I have set Filter and FilterOn properties.

    Might require the RecordSource to not have SORT BY clause.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Something like this?? It is a just a single column sort.... multiple column sorts are a lot more complicated.

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

Similar Threads

  1. Replies: 2
    Last Post: 03-12-2014, 01:31 AM
  2. Replies: 2
    Last Post: 10-05-2012, 07:52 AM
  3. sort option button
    By turk in forum Access
    Replies: 9
    Last Post: 03-08-2012, 03:16 PM
  4. Replies: 8
    Last Post: 01-17-2012, 02:43 PM
  5. a-z sort for control button
    By darklite in forum Access
    Replies: 7
    Last Post: 05-28-2010, 04:49 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