View Full Version : Copy Row with subdata between


MilleRrrr
07-15-2008, 05:05 AM
first post here.

I have a two fold question

1)

I would like to have data from 2 related tables (Parent/child) copied into another 2 related tables.

One table holds the "standards" data and sub data and the New tables hold the data that will be manipulated by users. So the application will transfer the standards to the operational tables.

any help on how to transfer 1 row of master table and all of the sub-data that is associated to the operational tables (Table 2 / 2sub xfer to Table 1/1sub)

2)

I have a test database with 4 tables each table has matching data types. If I manually copy/paste transfer the data from on table to the other (table 2 -> table 1), then try to delete the row Access application crashes.

but...

If I manually put data in the table1 and delete the row there is no problem with deleting the row.

any ideas on why the access would crash.

attached is the test db
Currently using Access 2003 (2000 file format)

Pat Hartman
07-15-2008, 10:32 AM
Welcome aboard.
1) You can't do this with a single query. You need to use two queries. One for the parent record and a second for the related child records. Make sure that both take the Parent's key as an argument so the correct data will get copied.
2) Transfer the data with append queries. Only the Access gods know why Access is so sensitive about such things.

MilleRrrr
07-15-2008, 01:10 PM
Thanks for the welcome aboad.

Any ideas on how to keep the ID from being duplicated since I am going from one set of tables to another?

Pat Hartman
07-15-2008, 07:56 PM
Every table needs a primary key. That will keep the same ID from being added multiple times.