Keep current record current after sort

Posted on 2009-04-29
Last Modified: 2013-11-28
I have a continuous subform that is sorted by ProjID. ProjID is bound to a combo box that is used to select a given project number. When  the project number is changed, the location of the record in the continuous form shifts to meet the sort criteria (after a requery to populate the rest of the data for the record based on the project ID).

Is there a way to highlight (select) the record that was altered so as to not have to search for the new project in the list?

Question by:walkingbush
    LVL 119

    Accepted Solution

    before the requery of the form, assihn the current record in a variable, the use FindFirst to get back to the record

    dim varID
    varID= me.recID

    'requery the form

    with me.recordsetclone
        .findfirst "[recID]=" & varID
        if not .nomatch then
       end if
    end with


    Author Comment

    Awesome! Worked perfectly.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
    In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
    In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
    With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now