• Sort Code (2.0)

    Author
    Topic
    #363768

    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!

    Viewing 1 reply thread
    Author
    Replies
    • #556157

      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

    • #556166

      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.

    Viewing 1 reply thread
    Reply To: Sort Code (2.0)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: