Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Easy sort question 1

Status
Not open for further replies.

Petemush

Technical User
Jun 21, 2002
255
GB
In reports, you can have levels of sorting.

Is this possible with tables?

I know how to make sure a table is always ordered by one thing but how do I set it so that a table is ordered by one field, and then those are ordered alphabetically?

Anyone know?

Gotta a feeling this is easy but I just don't know!

Cheers,

Pete
 
Pete,

Lets try to answer your question. There are a number of angles to the answer, so here goes. Note I stand to be corrected on the material below; its based on thinking about your question and experience, but no explicit research:

(a) A table, if it has no indexes will present itself in the order in which the data is entered.

(b) If it has a Primary Key, then it will present itself in the order of the primary key.

(c) If it has no primary key but another non primary index, then it will present itelf in the sequence of this index.

(d) If there are multiple non primary indexes, the sequence probably depends on the order within the index list (feel free to check this out).

(e) Philosophically speaking, the order in which the data appears in a table is unimportant. The Access User interface is intended to be via Forms connected to queries which connect to the 'raw' tables. The ORDER BY clause in SQL is whats intended to control the sequence of presentation of data.

(f) There are other ways to control the sequence of presentation of data; for example, if you are looking at 'raw' table data, you can temporarily change the sequence by using the AZ and ZA buttons on the toolbar. Point to the label of the field you want to sort by and then click the AZ or ZA buttons to get that field sorted in ascending or descending sequence. There are more complex variations of doing this to allow multiple fields to be sorted at the same time.

(g) Levels of sorting are achieved in queries by lining up the fields you want sorted, from left to right, and then selecting the Ascending or Descending criteria for each of these fields.

I hope that you find this helpful,

Cheers,

Steve Lewy
Solutions Developer
steve@lewycomputing.com.au
 
Cheers Steve,

Point f) very relevant, I'm only interested in what the user sees really so have followed point g) and based the forms on queries which have sorted criteria rather than basing it on the raw table.

Thanks again,

Pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top