Instead of concatenating the fields, add a unique index which is a compound
index including all three fields. Open the indexes dialog, give the index a
name, then add the 3 fields. While you can make this index the Primary Key,
I'd advise against it. A Primary Key is often used as a Foreign Key in
other tables. If the key had more than a single field, then you will need to
add the additional fields to the secondary tables. This is clumsy and
inefficient. The better design, IMO, is to use an autonumber as a Primary
Key, then construct a unique index on the other 3 fields.
Certain Primary Key fields do have meaning. Take State Abbreviations or
Country Codes for example. Both are unique, small, and efficient and are
excellent candidates for Primary Keys. It would be ridiculous to add yet
another value to a table of states or countries.
There are other reasons to use surrogate keys as Primary Keys. One is that
they are usually machine generated and unlikely to be duplicated, so you
don't have to check for the duplication. Another is in queries. Long
Integers use 4 bytes and require less processor and network resources than
Unicode text which uses 2 bytes per character, or older non-Unicode which
uses 1 byte per character. If I need to retrieve the primary and foreign
keys for a total of 50,000 records, I am looking at 8 byte joins instead of
as much as a 60 byte join for a 3 field 5 character primary key (5
characters x 2 bytes x 3 fields x 2 tables)
Anyway, to make a very long explanation short, there are thorough
explanations in a number of good books on database design. Have a look for
authors Rebecca Riordan, Steven Roman, and Michael J. Hernandez. If you
really want to delve into deep technical explanation look up "The Relational
Model for Database Management" by E.F. Codd and C.J. Date.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access