Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2003
    Posts
    48

    Question Unanswered: Can I use Query/s to Sort Records by Fields listed in Combo Box in Data Access Page?

    Hi People!

    I've been browsing the forum to see if anyone has posted anything about sorting records in order using a Combo box to designate the field to sort by, e.g. date, record ID number, Department, Status, etc.

    I found a lot of 'filtering' posts, but no concrete solutions for sorting.

    Also, I'd better try to confirm if such a thing is actually possible in a Data Access Page (as this is what I'm using to display the records).

    Can anyone confirm this is possible in a DAP, and I'd be very grateful if someone could post or point me in the direction of an example of such a Combo Box with it's values set to corresponding queries that will sort the records based on the fields in the Combo Box!!!

    Much appreciated if anyone can shed some light on this for me!!

    Cheers,

    Luke

  2. #2
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    i don't know a way to do this directly with a saved query (...in the same way that you can set criteria to look at a text-box).

    you could mess with the querydef but there doesn't seem to be much point: easier is to abandon the saved query and use SQL directly adding:
    strSQL = strSQL & "ORDER BY " & forms!myForm!myCombo.value & ";"
    to the tail of your SQL (...generated in A's query grid if you are feeling lazy)

    izy

  3. #3
    Join Date
    Aug 2003
    Posts
    48
    Thanks for this!!

    I'll give it a go.

    Cheers,

    Luke

  4. #4
    Join Date
    Aug 2003
    Posts
    48
    Hi izyrider!

    I'm currently applying the code you provided.

    Do I need to use some kind of refresh or requery command for the page after this code to allow the page to resort the order of the records on the page?

    Cheers,

    Luke

  5. #5
    Join Date
    Aug 2003
    Posts
    48
    I don't suppose anyone else out there has any ideas on this.

    You probably wouldn't be able to accurately comprehend the true extent of my gratitude!!!

Posting Permissions

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