Why do my forms not open in order of primary key?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an access table set up with an auto number as the primary key. My
form to put info into this table is based on a query with the this primary in
ascending order. However the forms are all there but not in numeric order
and it would be nice if the PrimaryKey and number of forms were equal.
 
On Tue, 7 Jun 2005 17:00:28 -0700, "E R B" <E R
I have an access table set up with an auto number as the primary key. My
form to put info into this table is based on a query with the this primary in
ascending order. However the forms are all there but not in numeric order
and it would be nice if the PrimaryKey and number of forms were equal.

A Primary Key is just an automatically assigned unique key. It will
ALWAYS have gaps. Not only will deleting records cause gaps, but if
the user hits the <Esc> key while entering a record, you'll get a gap
in the autonumber sequence; they can even become random. It's best not
to display the autonumber at all, as it can be confusing to users!

If you do want to see records in some particular order, base your Form
on a Query sorting the records by the field or fields in question.
Tables have no defined order, and the records will be presented in
whatever sequence the query optimizer finds convenient.

Just another note - the "number of forms" is confusing in Access
jargon; a Form is a data display tool, an Access object which can be
used to display or edit data in a table. I'm guessing you meant that
"the number of records were equal" - and you're going to have great
difficulty doing that, if you ever allow any records to be deleted.

John W. Vinson[MVP]
 
Back
Top