locked
How do I move a selected record to the top of a form in Datasheet view after returning from another form? RRS feed

  • Question

  • Hello,

    I have a subform, that displays in datasheet view.  The datasheet displays a list of records from a SQL view.

    On the datasheet I have a Job Number field (along with other fields).  When the Job Number is double-clicked, another form is then opened that contains detailed information about that Job.  When that form is closed, I would like to move the selected Job Number to the top of the datasheet,  followed by jobs that are listed after.

    The Datasheet form Record Source property is a sql statement:

    SELECT * FROM dbo_view_invoicejobslist ORDER BY dbo_view_invoicejobslist.jobnumber DESC , dbo_view_invoicejobslist.drop;

    How would I do that?  Thanks so much for your help!

    smsemail

    Wednesday, March 20, 2013 7:18 PM

Answers

  • You can add a Yes/No field for TopOfHeap so it is checked as part of the double click event and add it to the ORDER BY  dbo_view_invoicejobslist.TopOfHeap DESC, dbo_view_invoicejobslist.jobnumber DESC, dbo_view_invoicejobslist.drop;

    Upon return do refresh.

    Then have an update query triggered on form close to remove check of the Yes/No.

    • Marked as answer by Dummy yoyo Wednesday, March 27, 2013 12:50 PM
    Wednesday, March 20, 2013 8:40 PM