copy records and related subrecords

cewolf

Registered User.
Local time
Today, 10:31
Joined
Oct 8, 2011
Messages
10
Greetings all

i am having a small problem i can't solve , i have been looking for an answer
for a day but couldn't find any

i have database build as a set of "Books" , each book has several drawings and each drawing contains several rooms
(see attachment for relations details )

so i would like to select a group of drawings records and copy it with what ever rooms data related to them and paste that data -drawings and rooms- into another book ( say from book 13 to book 21)

any ideas ....

and please note that i am not that great in coding !! so please try to be as detailed as possible

thanks


Capture.jpg

Capture2.JPG
 
Build a macro with 2 queries...
1st to copy the master record using the ID.
2nd to copy the child recs.
 
Yours will be more complicated but see if this gets you started:

http://allenbrowne.com/ser-57.html

I think you'll need a second recordset for the middle level, looping it.
 
Greetings all

i am having a small problem i can't solve , i have been looking for an answer
for a day but couldn't find any

i have database build as a set of "Books" , each book has several drawings and each drawing contains several rooms
(see attachment for relations details )

so i would like to select a group of drawings records and copy it with what ever rooms data related to them and paste that data -drawings and rooms- into another book ( say from book 13 to book 21)

any ideas ....

and please note that i am not that great in coding !! so please try to be as detailed as possible

thanks


View attachment 61365

View attachment 61366

I don't know your app but on the general level, if the "books" are copy-able , the simplest solution would be to assign a second ID to a book and call it ,say, Grp_ID. Then make the drawings dependent on a new key, say "Grp_ID" rather than the B_ID. When you create a second (third, etc) book for the same group, you only need to copy the Grp_ID as a foreign key to the Draw Table (instead of B_ID) only once and the draw table (and room table below) can serve multiple "books". If you then make a change to the data in dependent tables, you only need to do it once, and it will be automatically valid for all "books" that own the collection (ie have the same Grp_ID). So let's say you want to copy Book's 13 group to Book 21, all you need to do is copy the Grp_ID of Book 13 to Book 21.

No obviously this will only work if you truly want to copy data in books and the data remains the same for all the multiple books.

Best,
Jiri
 
sorry for my late reply ..
i got busy

thank you all for your replies , i will take some time to check them later
thanks
 

Users who are viewing this thread

Back
Top Bottom