Making 3 fields a primary key????

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • scolivas
    New Member
    • Oct 2006
    • 56

    Making 3 fields a primary key????

    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?
  • Tanis
    New Member
    • Mar 2006
    • 143

    #2
    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.

    Comment

    • scolivas
      New Member
      • Oct 2006
      • 56

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

      Comment

      • KelHemp
        New Member
        • Oct 2006
        • 16

        #4
        Originally posted by scolivas
        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.

        Comment

        • sherylnance
          New Member
          • Oct 2006
          • 4

          #5
          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.

          :-)

          Originally posted by scolivas
          I need to use the compsite because it's a shipping log. How do I get the primary key to display in the table?

          Comment

          Working...