Results 1 to 3 of 3

Thread: Sort Code (2.0)

  1. #1
    Star Lounger
    Join Date
    May 2001
    Location
    New Jersey, USA
    Posts
    55
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Sort Code (2.0)

    I have a form that shows data. ( Parts my company makes with dimensions and other information.) I want to be able to sort ascending and descending. What is the code for the command buttons?
    I looked in Access help and could not find an example.

    Thanks!

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sort Code (2.0)

    I don't remember the syntax for version 2.0 but in 97:
    for ascending:
    Me.OrderBy = "MySortFieldName"
    Me.OrderbyOn=True

    for descending:
    Me.OrderBy = "MySortFieldName DESC"
    Me.OrderbyOn=True

    But why put command buttons, that exist in the Toollbar, on your form? (the buttons with AZ and ZA with an arrow)
    Learn your users to use the fundamentals of Access and your life will be simpler
    Francois

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Sort Code (2.0)

    I suspect you're going to have to try doing this in a macro to figure out the code. It will probably be one of the DoMenuItem actions, but Access 2.0 and AccessBasic are so far in my past, that I don't recall the details.
    Charlotte

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •