S
Scott Parmelee
Hi,
I have a table, that has a related table with "child" rows, and that table
has two more related tables. Each table as an auto-number as the primary
key and relations set up between the tables.
I would like to duplicate a row and all child related rows. I have seen
Allen Browne's excellent documentation and sample at
http://allenbrowne.com/ser-57.html, but that only goes one level deep. I
then saw an older newsgroup posting where he discussed deeper levels and
advised:
"If you have a 3rd relational level:
1. Use DAO to create the first level duplicate and get the new ID.
2. Use DAO in a loop to create the 2nd level duplicates, using the
ID from step 1 as foreign key, and getting the new primary key.
3. Within the loop, Execute an SQL string that employes the primary
key from level 2 as the foreing key for level 3. "
but I'm getting confused at this point. I'm not sure at step 2 what I
should be looping through, a recordsetclone of the subform perhaps? Does
anybody have any handy examples?
Thanks,
Scott
I have a table, that has a related table with "child" rows, and that table
has two more related tables. Each table as an auto-number as the primary
key and relations set up between the tables.
I would like to duplicate a row and all child related rows. I have seen
Allen Browne's excellent documentation and sample at
http://allenbrowne.com/ser-57.html, but that only goes one level deep. I
then saw an older newsgroup posting where he discussed deeper levels and
advised:
"If you have a 3rd relational level:
1. Use DAO to create the first level duplicate and get the new ID.
2. Use DAO in a loop to create the 2nd level duplicates, using the
ID from step 1 as foreign key, and getting the new primary key.
3. Within the loop, Execute an SQL string that employes the primary
key from level 2 as the foreing key for level 3. "
but I'm getting confused at this point. I'm not sure at step 2 what I
should be looping through, a recordsetclone of the subform perhaps? Does
anybody have any handy examples?
Thanks,
Scott