Let me add my agreement to what Bruce and Rick have said. The problem with
allowing users to see the values of an autonumber field really only exist if
the users expect the value to have some substantial meaning and/or to be
sequential. Where I work we trained the users long ago to have different
expectations.
The most important thing for you to understand is the purpose of a Primary
Key. It is intended to uniquely identify a record within the database. Using
an AutoNumber may or may not uniquely identify the values in a given record.
Thus, it is important to create a unique index on a Candidate Key that will
accomplish that. Let me illustrate the point. If you have an Employees table
with an AutoNumber field as the Primary Key, but with no unique index on
other fields, it is possible to end up with data like the following.
EmployeeID LastName FirstName Address
1 Smith Jack
111 1st St.
2 Smith Jack
111 1st St.
Now, for the purpose of the database engine, those are unique records.
However, they may or may NOT be unique in the real world. It is very
possible to have 2 Jack Smiths living at the same address and working for
the same company. An AutoNumber will NOT guarantee that the values in the
rest of the fields is unique. Also, with tables like Employee tables and
Person tables, it can be very difficult to find another Candidate Key that
will uniquely identify the values. You may even have to allow users to enter
identical information if they believe it is validly a different person.
For other kinds of tables -- such as your Purchase Order table -- there is
no reason that an AutoNumber field cannot be used for the PO Number AND also
made available to the users. Purchase Order Numbers typically have no
meaning anyway and it doesn't matter whether or not they are sequential. The
same would probably be true of an Invoices table. However, for an AP
application from which checks are issued and deposits are entered, it is not
a good idea to use an AutoNumber field because of the problem with gaps. A
gap in a check number or deposit number sequences throw accountants into the
heebie jeebies, for good reason. For tables like those you will want to use
some other process for developing the unique and sequential numbers.
--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security:
www.ltcomputerdesigns.com/Security.htm
Jeff Conrad's Access Junkie List:
http://home.bendbroadband.com/conradsystems/accessjunkie.html