Results 1 to 4 of 4
  1. #1
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,371

    Sorting Subform from cmd button

    Hi Guy's, i have tried looking to see how i can sort a certain field on a subform from a command button



    this works to sort A-Z

    Code:
    Me!frmItemsData.Form.OrderBy = "Carbs"Me!frmItemsData.Form.OrderByOn = True
    I now want to sort Z-A ?

    tried changing OrdbeyOn to False but that appears to change to original sort order (RecordNo) integer

    Thank you

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,614
    Try:
    Code:
    Me!frmItemsData.Form.OrderBy = "Carbs Desc"
    Me!frmItemsData.Form.OrderByOn = True
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,371
    Bob, it was as simple as that, why i couldn't see that I'll never know

    I do use ASC or ; and DESC quite frequent in SQL statements but did not cross my mind!!

    Thank you very much indeed

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,614
    Quote Originally Posted by DMT Dave View Post
    Bob, it was as simple as that, why i couldn't see that I'll never know

    I do use ASC or ; and DESC quite frequent in SQL statements but did not cross my mind!!

    Thank you very much indeed
    Sometimes, the most obvious can be the most elusive and always pleased to help if I can
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

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

Similar Threads

  1. Subform Datasheet View Sorting
    By Tina007 in forum Forms
    Replies: 3
    Last Post: 04-05-2015, 08:22 AM
  2. Sorting a subform within a Report help
    By Lorlai in forum Reports
    Replies: 4
    Last Post: 03-21-2013, 08:11 AM
  3. Replies: 7
    Last Post: 03-01-2013, 01:02 PM
  4. Sorting subform records
    By Remster in forum Forms
    Replies: 4
    Last Post: 11-17-2010, 10:39 AM
  5. Sorting in a subform
    By hraup in forum Forms
    Replies: 2
    Last Post: 08-29-2006, 12:35 PM

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