Secondary Sorting in a table

  • Thread starter Thread starter mbergman
  • Start date Start date
M

mbergman

How do you define a sort order in a master table? I.E. I
have a large table that lists candidates with numerous
fields. I candidates to be listed by last name, then all
candidates with the same last name to be sorted by first
name. The sort order would update each time a new
candidate is entered.
 
You can either use a query. If you open your table and
click the Records Menu and do an advanced filter/sort it
will take you to a new query.

Or, try this....

highlight the two columns at the same time and click
Records > Sort > Sort (asc/desc)
 
I candidates to be listed by last name, then all
candidates with the same last name to be sorted by first
name.

Put a sort in the query

SELECT ....
FROM Master
ORDER BY LastName, FirstName

or just set the options in the query design grid.

There is a hint in the question, although I am sure that I am mistaken,
that you are actually using the table datasheet to edit records; but this
is such a cruel and nasty thing to do to your users it cannot be true. I am
certain that you are using a form based on a query, which can be easily
sorted as above.

Best wishes


Tim F
 
mbergman,

Data in tables are not sorted. Generally there is no need to do so,
as in normal usage of a database, no-one ever sees the table anyway.
You can abtain a dataset sorted in the way you want, for your purposes
on form or report, by applying sorting in a query based on the table.

- Steve Schapel, Microsoft Access MVP
 
How do you define a sort order in a master table? I.E. I
have a large table that lists candidates with numerous
fields. I candidates to be listed by last name, then all
candidates with the same last name to be sorted by first
name. The sort order would update each time a new
candidate is entered.

You don't.

A Table is an unordered "bag" of data. Access will store the records
wherever there is room on disk.

If you want to see the candidates in alphabetical order, use a Query
based on the table, sorted by last name, first name, and any other
desired sort fields.
 
Back
Top