Results 1 to 3 of 3

Thread: Access does not allow Primary key with two fields

  1. #1
    Join Date
    Apr 2009
    Posts
    65

    Access does not allow Primary key with two fields

    I have a table with a student id and course id. The People table has a record for each individual. A record in the orders table will have multiple "People" in it (e.g., Person Placing the Order, Technical Contact, Budget Officer, etc.).Then I have a composed key. But this is not normal.

  2. #2
    Join Date
    Feb 2006
    Posts
    331

    Re: Access does not allow Primary key with two fields

    You will need to Open the table in design view, then you need to pulled the records from the selectors there you would get square blocks where on the left column name of the 2 columns you want as PKs, or, then hold the Ctrl & click the record selectors of the columns you want as PKs. use an Autonumber as your primary key. If there are other fields that need to be unique, I create a unique index on them. Then On the main window on the main menu click Edit > Primary Key. Once this has finished Close & Save the table. If there is duplicate data in the PK columns you will not be able to save the new table design.

  3. #3
    Join Date
    Jan 2009
    Posts
    71

    Re: Access does not allow Primary key with two fields

    when you are in the relationship window, drag the relationship from People to the first field, check Referential Integrity (RI) store the customer's address in each record in the Orders table, you store that information once in a record in the Customers table.In general you could have guessed this answer if you imagined that columns not indexed separately, but indexed concatenation of columns (it's not completely true, but it works for first approximation).

Similar Threads

  1. In MS access fields are not accepting data properly
    By UTTIYA in forum Windows Software
    Replies: 3
    Last Post: 10-03-2011, 07:37 AM
  2. Ms access: Fields not taking the data properly
    By Enton Dou in forum Windows Software
    Replies: 3
    Last Post: 06-02-2011, 04:54 PM
  3. How to Auto fill certain fields In a Access 2003
    By Rebella in forum Software Development
    Replies: 3
    Last Post: 24-09-2009, 12:52 PM
  4. How to add two fields in ms access?
    By lootera in forum Windows Software
    Replies: 3
    Last Post: 03-09-2009, 09:18 PM
  5. How to Automatically access the fields of an Access 2007 forms
    By Corona in forum Software Development
    Replies: 3
    Last Post: 25-06-2009, 12:54 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,453,477.92487 seconds with 17 queries