Share via

setting/removing sort order from form

Anonymous
2018-03-23T00:56:09+00:00

I have a form set up where the user selects the records displayed on the detail section from a combo box in the header. Is there a way to not sort the records and just place them in the order of selection? My form detail records keep resorting and moving out of the order I selected them in. I want the first line to be the first record I selected, the second on line 2 and so on. I have removed all sort by from the record source and still the records are sorted by - something I'm not sure by what.

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Tom van Stiphout 40,211 Reputation points MVP Volunteer Moderator
2018-03-23T02:08:49+00:00

> Is there a way to not sort the records and just place them in the order of selection

Records are always displayed in SOME order, so "not sort" is illogical. "No discernable sort" can occur, but that's a limitation of the human, not Access.

What do you mean with "the order of selection"? Reading between the lines you somehow select records, and as you do so, you want them shown in that order. Did I get that right? If yes, you would need to store the SelectDateTime in a field in the underlying table; then you can Order By that field and mission accomplished.

Was this answer helpful?

0 comments No comments

Answer accepted by question author

Anonymous
2018-03-23T02:06:14+00:00

Can you explain the mechanism whereby the user's selections from the combo box are displayed in the form's detail section?  What is the RecordSource query (or table) of the form?

Is this a multi-select combo box (which I think would have to be bound to a multivalue field) or does the user repeatedly select one record at a time?

If the form has its OrderBy property set, and its OrderByOn property is also set, that could be of course be affecting the sequence of the records.  But even without that, Access will display the records from an unordered query in a sequence that is determined by the operations that it uses to execute the query -- often by the primary key sequence of one of the tables involved.

If you need the records to be returned according to the sequence in which they are selected by the user, then you'll need (somehow) to make that sequence part of the data in the query, and have the query -- or the form's OrderBy property -- sort on it.

Was this answer helpful?

0 comments No comments

0 additional answers

Sort by: Most helpful