Results 1 to 7 of 7
  1. #1
    bcmarshall is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jul 2010
    Posts
    95

    Can I get new record to appear at the top of a query output?

    I have a select query in descending order, with the most recent on top. The problem I have is that the new record always appears at the bottom of the list.



    Is it possible to sort in such a way that I get this type of sort as the output of the query?

    New Record
    Most Recent
    Second Most Recent
    Third Most Recent
    etc...

    I don't know if it's possible to do that way, but for my purposes it would be ideal.

    Suggestions would be appreciated.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    Not really; the new record will always be at the bottom. I've seen the look you're after achieved with two subforms: one in data entry mode right above another showing the rest of the records with allow additions set to no. I've also seen it done with unbound text boxes above the form/subform, with code to add the record.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Many I am missing something or not understanding the question, but what if you add an Autonumber field to your underlying table (before data entry), and then have your query sort by the Autonumber field in Descending order. Then you most recent record should be at the top, 2nd most recent listed 2nd, etc...

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    I believe the issue is with the new record (the one with empty fields that isn't yet a record), not the most recent record.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    bcmarshall is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2010
    Posts
    95
    You're correct, pbaldy. If I have a dozen records sorted descending, the new record always appears at the bottom of the list, and that's the issue I was trying to solve.

    The solutions you offered seem to be the only way to achieve what I'm trying to accomplish, unless someone else has another idea!

  6. #6
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Ah, yes. I figured I wasn missing something.
    If I ever had to do something like that, I would go with Paul's suggestion. I can't think of any other better way of doing it.

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    There may be another way, but those are the only two I've seen. You'd think there would be a form setting to control that, but there isn't (AFAIK).
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Output query to list box
    By shabbaranks in forum Programming
    Replies: 4
    Last Post: 02-08-2012, 09:53 AM
  2. Ho do I output query to a list box
    By shabbaranks in forum Queries
    Replies: 1
    Last Post: 02-06-2012, 07:17 AM
  3. specific record output to .pdf
    By REBBROWN in forum Reports
    Replies: 1
    Last Post: 09-25-2010, 07:35 AM
  4. Output Query to Text
    By denileigh in forum Queries
    Replies: 1
    Last Post: 05-27-2006, 12:34 PM
  5. How to output only current record in query
    By mslieder in forum Access
    Replies: 0
    Last Post: 01-20-2006, 05:48 PM

Tags for this Thread

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