Sort order in a table

  • Thread starter Thread starter Guest
  • Start date Start date
You don't. The order of records in a table is not relevant. You specify
the sort order of your records in your queries, forms, and reports.

If you want them stored in a particular order that can't be based on some
field in the data, then you will need to add a sequential field which you
can use for sorting the data.
 
Adding to what Rick B said.

The order of records in a table has no real meaning in a relational
database. It might seem like it or even act like it, but unless you have
something to sort on in a query, you can't depend on it. You can open a table
and see records in some order, but they might not be in the same order the
next time you open the table.

In spreadsheets someone probably entered the data in a specific order. When
you reopen a spreadsheet you surely expect the data to be in the same place.
That's how spreadsheets work.

Now the problem becomes one of taking something that is in order
(spreadsheet) and dumping it into something that doesn't maintain order
(table). Is there any column or combination of columns in the spreadsheet
that maintains an order? For example if you sorted on that column(s) in the
spreadsheet, the data would stay where it should? If so is this data unique
enough to make a good candidate for a primary key or unique index in the
table? If so, life is good. Just sort on that unique index in queries and
your data is in order.

If not you might be able to link to the spreadsheets instead of importing
then use a query to append the records to a table in the sequence you wish.
In this case you would also want to add a field that contains the sort order.
An autonumber field might work; however, even autonumbers are not guaranteed
to be sequential.
 
Jerry Whittle, thanks for your help, my main problem is that I key in my
customers accounts to the table using a form and then when I want to print an
individual report the record number on the report is different to the number
of the form and I have to search through all the report numbers to find the
individual record. Previously when I was using Access in Office pro the
records all stayed in order!! I'll try the auto number and see if it works
Thanks again. Cath:-)
 
Back
Top