Combination of two fields as primary key?

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
 
L

Les

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.
 
A

Allen Browne

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.
 
G

Guest

Thanks, Les. I'll give it a try. Are there drawbacks in
having a combination of two fields as the primary key?
 

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