Results 1 to 2 of 2
  1. #1
    Fatbot is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2011
    Posts
    1

    Primary and foreign key in relationships?

    Hi there

    I am having some trouble with Access that I hope you can help with.

    I currently have two tables.

    CUSTOMERTABLE:
    PK - cust_id
    firstname
    lastname
    street
    city
    state
    postcode


    ORDERTABLE
    PK - order_id
    product_id


    prod_descrip
    prod_price

    I am trying to set them up in a relationship and am wondering if it's possible to add the cust_id as a foreign key in the ORDERTABLE? I can link up cust_id with order_id in a relationship but the cust_id doesn't move across as a foreign key like it does in Visio. Is this possible to do?

    Many thanks for your help!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Yes, cust_id should be added as a field in the order table.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Multiple Foreign Help
    By Dalagrath in forum Access
    Replies: 2
    Last Post: 11-01-2010, 10:25 AM
  2. import the foreign key into the primary key
    By vCallNSPF in forum Forms
    Replies: 3
    Last Post: 01-14-2010, 06:51 PM
  3. Getting a foreign key set
    By bkelly in forum Access
    Replies: 5
    Last Post: 08-18-2009, 09:22 PM
  4. Primary/foreign keys + relationships
    By tripptofer in forum Database Design
    Replies: 0
    Last Post: 08-12-2009, 07:44 AM
  5. Foreign Data
    By bmiller in forum Queries
    Replies: 0
    Last Post: 03-21-2006, 01:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums