Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2003
    Location
    Shrewsbury, England
    Posts
    4

    Question Unanswered: Copy Related Acces Tables

    I've created a database with two tables

    RunList
    RunListItem

    They are link using a relationship on the field Runlist_Id which is an autonumber.

    I wish to copy both the parent record and it's related child records keeping the new link between them intact, i've looked into doing it with an insert SQL stament and I can copy the parent record but not sure how to go about copying the child records and keeping these linked to it's new parent.

    Hope this makes sense cos i'm lost!!!!

  2. #2
    Join Date
    Aug 2003
    Location
    Argentina
    Posts
    465
    You cant use and autonumber field for do that.
    You must use the Parent Number and Component Number.
    Something like BOM ( Bill Off Material Proccesor ).
    See in Web about that , there is and free Sample.
    Saludos
    Norberto

  3. #3
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941
    If RunList is the parent, then only it's RunList_ID field should be autonumber. The RunList_ID field in RunListItem should be Long.
    Then to copy the records, do the following:

    Insert your new record into the RunList table
    Get the RunList_ID for the record you just inserted
    Get the rows you need to copy from RunListItem
    For each row, insert it to RunListItem with the new ID number

    If your not sure how to code all of that, let me know and I'll get back to you.

    Mark
    Inspiration Through Fermentation

Posting Permissions

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