Primary Keys

M

Martino165

I have been reading some of the discussion pertaining to setting
primary keys (ie. artificial versus multi-field primary keys, etc.)

I was wandering if there is any use for creating specific nomenclature
for the primary key and having a text field be the key field (e.g.
study year_author(first 5 letters)_autonumber(3#s)

1999_marti_001

If so, is there a way of automatically generating these values based on
set nomenclature.
 
D

Douglas J Steele

Realistically, it's a violation of relational database theory to combine
multiple fields into one: each field is supposed to contain only one piece
of information. Keep the 3 fields separate: Access allows you to specify up
to 10 separate fields as part of the Primary Key. If you need to display
that concatenated key for legacy purposes, you can create a query that has a
computed field in it:

OldKey: [Study Year] & "_" & Left([Author], 5) & "_" & [AutoNumber]

and use the query wherever you would otherwise have used the table.
 

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