Moving Multiple Related Records

Discussion in 'Microsoft Access Queries' started by Tony, Jun 22, 2004.

  1. Tony

    Tony Guest

    Hi All,

    I've got a problem that I hope can be solved by some function in Access but
    am unsure as to where to start. I'm using Access 2000 and have a database
    with three tables linked by autonumber primary keys. The problem is that I
    inadvertently blew away some records and their related records - first table
    cascades to second cascades to third. I have a good backup and all the
    records, but it's been awhile since the gaffe, so I just can't restore from
    the backup without overwriting new records.

    I think I start by building a make-table query in the backup to combine the
    three tables, import into a temp table in the production db, then split into
    three related temp tables. Where I'm stuck is how to append the records
    from the temp tables to the production tables while maintaining the
    relationships.

    Any help is much appreciated.

    Thanks & Ciao,

    Tony
     
    Tony, Jun 22, 2004
    #1
    1. Advertisements

  2. Tony

    Joan Wild Guest

    Hi Tony,

    Tony wrote:
    > I've got a problem that I hope can be solved by some function in
    > Access but am unsure as to where to start. I'm using Access 2000 and
    > have a database with three tables linked by autonumber primary keys.
    > The problem is that I inadvertently blew away some records and their
    > related records - first table cascades to second cascades to third.
    > I have a good backup and all the records, but it's been awhile since
    > the gaffe, so I just can't restore from the backup without
    > overwriting new records.
    >
    > I think I start by building a make-table query in the backup to
    > combine the three tables,


    No, I wouldn't do this. If you want just the records involved, I'd create
    three tables (actually you could link to the backup database and use queries
    to get the records, but your approach may be safer/easier).

    >import into a temp table in the production


    Import the three temp tables.

    > db, then split into three related temp tables. Where I'm stuck is
    > how to append the records from the temp tables to the production
    > tables while maintaining the relationships.


    You can use an append query to append the records in - just include the
    autonumber, and append it into the autonumber field in your production
    database - you can do this, rather than letting it create new numbers.

    You might want to double check that those autonumbers were not reused (which
    could have happened if you weren't uptodate with Jet service packs.

    As always, test on a copy of the production mdb.

    --
    Joan Wild
    Microsoft Access MVP
     
    Joan Wild, Jun 23, 2004
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Cliff

    Show Records Where All Related Records Are False

    Cliff, Jun 4, 2004, in forum: Microsoft Access Queries
    Replies:
    1
    Views:
    187
    Cliff
    Jun 4, 2004
  2. Guest

    filter some records and permit all other related records

    Guest, Oct 3, 2006, in forum: Microsoft Access Queries
    Replies:
    0
    Views:
    208
    Guest
    Oct 3, 2006
  3. Marc Eckhert
    Replies:
    3
    Views:
    199
    Jeff Boyce
    Feb 20, 2007
  4. Jojo
    Replies:
    1
    Views:
    385
    Allen Browne
    Aug 30, 2008
  5. bymarce

    Multiple Matching Records in Related Table

    bymarce, Sep 18, 2009, in forum: Microsoft Access Queries
    Replies:
    4
    Views:
    212
    bymarce
    Sep 25, 2009
Loading...

Share This Page