S
sadiamalik1980
How do you create a primary key from multiple fields in a table?
Regards
Regards
How do you create a primary key from multiple fields in a table?
Regards
John said:Open the table in design view.
Ctrl-leftclick each field which will be in the PK (it will darken to indicate
that it's been selected).
Click the Key icon.
John said:OHHH be careful, that question can start a religious war.
Personally I use both. Usually I use an artificial key such as an
autonumber, but in some cases a multi-field primary key makes darn good
sense.
A multi-field primary key in a junction table (many to many
relationship) makes a lot of sense to me. That way I can easily limit
the combination of fields (foreign key fields) to one per each type of
combination. I know I could do the same with a standard multi-field
index, but this case makes sense TO ME.
'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
'====================================================