• WendellB (12/18/2014)


    To do as you describe really requires the use of VBA - macros are too limited. I presume this is a continuous form that displays multiple records, and you wish to change the order of the records being displayed either after one record is edited, or by the use of a combo box. In the first case, where the data has changed, you would typically use the AfterUpdate event on the form to run VBA that says Me.Requery.

    In the second case, you would need more elaborate code that would change the Order By clause of the SQL string that is the record source. It would display a series of sort choices (By Name, By Date Entered, By Order Number, etc.), and depending on the choice made, you would modify the form record source SQL string accordingly. See this link VBA SQLstr to change subform record source ... for more details on the process.

    Yes it is continues form with multiple records.I need to change task priority for every record, and for this I want to use combo box, where i can change priority number. When a task with highest priority is done, it dissapier from the form view, and every record is re-counted for priority.

    Do you know a way how to generate order number just in form for every record from 1 to N , without adding special sql int column into table?