Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2002
    Location
    Hamilton,Ontario
    Posts
    132

    Question Unanswered: multiple primary key relationship problem

    I have three fields in a table

    table name: ITEM

    keys:
    ItemID
    Store
    Location

    and i have another table table name : ITEMHISTORY
    with 5 primary keys

    keys:
    ItemID
    Store
    Location
    Date
    Time
    Code

    What I'm trying to do is below

    table Item

    ItemID Store Location
    1 A A
    1 A B

    table History

    ItemID Store Location Date Time Code
    1 A A 2/2/03 0202 12
    1 A B 2/2/03 0202 12

    But the table Item: ItemID should be forgien key in table ItemHistory: ItemID
    How can I achieve this

    Thanks in Advance

  2. #2
    Join Date
    Jun 2004
    Location
    Florida, US
    Posts
    521
    I suggest you use primary keys only for identifying records like ID numbers. you can create a multiple index and make it unique either. make itemid primary key. and create another index which includes {ItemID, Store, Location, Date, Time, Code} fields and make it unique index. So you can have your primary key and still keep your fields unique.
    ghozy.

  3. #3
    Join Date
    Oct 2003
    Location
    US
    Posts
    343
    You have been doing things right. All you have to do now is use the relationship manager and link both tables on proper keys. Then in each relationship you can specify how they will work. Open up the relationships and try it out. It is under Tools --> Relationships

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •