Solved Sorting rows on a form

PaquettePaul

Member
Local time
Today, 15:28
Joined
Mar 28, 2022
Messages
107
I have a multi line subform that I use for data entry; e.g., segments of a multi-airport flight. I use the base table as my data source. My dilemma Is that after the user enters data, I have a need to sort the displayed rows in a specific order (such as flight start time) after each new record is added. There does not appear to be a sort option for the form.

A possible option is to use a query for the su form based on the specific table and put sorting in the query. Although, I do not even know if this would work In that if the user enters data in a new row, will the form save the data to the underlying table.

thanks for the assistance
 
I use the base table as my data source.
Or simply build your form on a query that is based on your table and sorted by time. Then in the afterupdate of the form do a requery to put the record in the correct order. In either case (using a query or the forms OrderBy property) you want to add a requery in the after update event of the form.
 
to be a sort option for the form.
01. Set "Order By" your form propery as you wish
02. On "After Insert" ivent of form set code:
Code:
Private Sub Form_AfterInsert()
    Me.Requery
End Sub
 
you can also use the form's AfterUpdate event to Requery your form.
 
Use after update.
... of sorting field ...
the sorting field event, not the form event
Otherwise the cursor will be reset

Together:
Use "After Insert" form ivent and "After Update" of sort field ivent.
 

Users who are viewing this thread

Back
Top Bottom