How can I stop access adding records in the middle of a table?

G

Guest

I have a form database which is linked to a table databse.
I created a new table in the table database from the form database using a
make table query (to split data into old and new records). Now when my users
add new records they are added to in front of the records, but in order....
so I get:
123, 124, 125, 1, 2, 3, 4, 5, 6 ...

The next record added will mean I get;
123, 124, 125, 126, 1, 2, 3, 4, 5, 6 ...

Any ideas ?
 
N

Nikos Yannacopoulos

By definition, tables store records randomly (think of a bucket of
data), no special order enforced. When data is displayed in datasheet
view, it is shown in ascending order on the primary key, if one exists -
but that is only for displaying, it doesn't mean the records are
actually stored in that order, nor can you do anything about actual
storing order.
In your case, I would guess the field you are referring to is indeed a
PK, and judging by the order you mention, a text field, even though the
values seem numeric.
Now, to display data in a controllable order, you need to make a query
on the table, impose the order in the query and display the query
instead of the table itself. To get what you seem to want in that
manner, you will have to either (a) change the PK field to numeric (so
the ascending order works right), or (b) employ a calculated field like
Val([YourPKField]) to sort on, which you don't have to display, or (c)
add an extra timestamp field to your table to sort on, with default
value = Date().

HTH,
Nikos
 
J

John Nurick

Hi Nikos,
By definition, tables store records randomly

It's not that the order is actually random, but that the system doesn't
promise to store the records in *any* particular or consistent order.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top