Copy a parent record along with child records

Irfan Salim

Registered User.
Local time
Today, 15:36
Joined
Oct 3, 2002
Messages
16
In my access database, there are two tables named: Project and Budget. Primary key for Project table is ProjectID. Fields of Budget table are Project ID, YearID, AmountDisbursed, AmountUtilized. Composite primary key of Budget table is (ProjectID, YearID). There is a one-to-many relationship between project and budget tables and cascade deletes, updates are enabled. What I want is copy some project ids along with their child records. But when I open the project table in datasheet view and use copy paste, only Parent record is copied.
 
Why do you need to copy some of the records. If you need to copy them it indicates that your data structure is not optimised.
 
Pat, does that preserve the link as when you append the primary records, the autonumber will change and hence the foreign key in the child table will be incorrect or does enforcing cascade update avoid this problem?
 
?

how do you know when you run the append query to the master table what the key is. I have some uses for this but got stuck at that point.

sam
 

Users who are viewing this thread

Back
Top Bottom