By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,841 Members | 1,761 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,841 IT Pros & Developers. It's quick & easy.

Making 3 fields a primary key????

P: 56
I'm in a crunch and can't remember how to do this....I have a table that has 3 fields - none of the fields will be unique by them selves, but if you put them all together they will create a unique #. I want to use that as the Primary Key in my table, but can't remember how to do it...I saw an earlier post but it didn't make sense to me. Do I need a separate field for the primary key? If so how do I set it up to import the data from the other three fields?
Oct 12 '06 #1
Share this Question
Share on Google+
4 Replies


100+
P: 143
I do NOT recommend composite keys. They tend to cause more problems then they are worth. I recommend using an autonumber as your primary key for all tables. If you want to enforce uniqueness on a combination of fields you can do that using a multi-field unique index. To create a composite key, open the Table in design view. To create a multifield Primary Key, ctrl-click each field that will be part of the key (so that they are all highlighted); then click the key icon.
Oct 12 '06 #2

P: 56
I need to use the compsite because it's a shipping log. How do I get the primary key to display in the table?
Oct 12 '06 #3

P: 16
I need to use the compsite because it's a shipping log. How do I get the primary key to display in the table?
what you might want to do is create a new column for "shipping log #" and set its control source to equal your three numbers in the order you want them to appear. You may need to have it be a text field instead of a number field, however.
Oct 26 '06 #4

P: 4
You can highlight the fields you want to make the primary key in the table design view and then click the primary key button on the tool bar.

:-)

I need to use the compsite because it's a shipping log. How do I get the primary key to display in the table?
Oct 26 '06 #5

Post your reply

Sign in to post your reply or Sign up for a free account.