Combination of two fields as primary key?

  • Thread starter Thread starter Ellen
  • Start date Start date
E

Ellen

Hello,
I am designing a database of people. Is there a way to
make both first and last names primary keys?

Thanks,
Ellen
 
Hi,
Highlight the first row as you would normally do to set
a primary key. Then, hold the shift key down, and
highlight the second row. At this point, you can click on
the key to create a primary key consisting of both parts
of name.
 
You can do that in table design view by selecting both fields (clicking the
"record selector" to the left of the fields), and then clicking the Key icon
(on the toolbar). Alternatively, you can open the Indexes dialog (View menu)
and create the index there.

However, is this really a good idea? What about is John Smith is named after
his Dad? You won't be able to enter them both. It's not unusual to have 2
people with the same name at the same address.
 
Thanks, Les. I'll give it a try. Are there drawbacks in
having a combination of two fields as the primary key?
 
Back
Top