joins in Access

Results 1 to 2 of 2

Thread: joins in Access

  1. #1
    Join Date
    Dec 1969

    Default joins in Access

    Hi. Can anyone help me. I have an Access database where I have 2 tables linked by Order ID. I have made Order ID an<BR> automatic number for both. However now, when I add details to the Order ID in one table, it doesnt create an Order ID in the<BR> other table.<BR> I am wondering if Enforce Referential Entegrity is needed, but it worked before without it and now it says I cant add it anyway.<BR><BR><BR> Thanks for your help.<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: joins in Access

    You can only create a persistent relationship between an autonumber and a number (long), not two autonumbers. If you have an order header and an order detail, the header would be the OrderID autonumber and a field in the detail would be the foreign key named OrderID and the type being a long. You then would have an autonumber key field in the Order Detail record named OrderDetailID for uniqueness. This would be a one to many relationship between header to detail. You could enforce RI and cascade updates. Be careful on setting cascade deletes and it will delete all records related to that order header record.

Posting Permissions

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