Is this the easiest way....?

mcgilla

Registered User.
Local time
Today, 09:11
Joined
Sep 17, 2010
Messages
31
I have a parent/child setup. A parent table that stores the "Name" of a recipe. Then I have a child table that stores order of ingredients and instructions with the "Name" of the recipe from the Parent Table and the order being the relational key.

I want to copy Recipe 1 to Recipe 2 within the same child table and then modify some of the ingredients. But with what I've been able to find in my search it seems the easiest way is to have a second child table with the same structure, copy recipe 1 to it, append it back to the original table but with recipe 2 as the relational key. And then of course, delete the data from the second child table.

While I'll probably use that method as the computer will do the work for me once it is setup, is there a way to copy it directly to the same table changing just the recipe name and keeping the order of addition/instructions the same?

Ed
---
Access 2007, Windows Vista Business.
 
I have a parent/child setup. A parent table that stores the "Name" of a recipe. Then I have a child table that stores order of ingredients and instructions with the "Name" of the recipe from the Parent Table and the order being the relational key.
--You might want to make the PK an autoincrementing ID column as opposed to the Name column. If you ever want to change the name you break the key.

I want to copy Recipe 1 to Recipe 2 within the same child table and then modify some of the ingredients. But with what I've been able to find in my search it seems the easiest way is to have a second child table with the same structure, copy recipe 1 to it, append it back to the original table but with recipe 2 as the relational key. And then of course, delete the data from the second child table.
--I would Create the new Recipe row (table 1). Get the PK.
Then use that new PK as the FK to create the child rows in table 2

While I'll probably use that method as the computer will do the work for me once it is setup, is there a way to copy it directly to the same table changing just the recipe name and keeping the order of addition/instructions the same?
--Addressing as I've suggested. If you are using a main form with two subforms to handle this... You can have a button that says.. copy as new recipe. Have that button insert the new row into table 1. Then use the newly created PK to append the rows from table2 ( where PK = PK from recipe being copied ) into table2.

hope the explanation is clear.
hth,
..bob
 

Users who are viewing this thread

Back
Top Bottom