Copying Records Using VBA SQL Statement

alathwell

Registered User.
Local time
Today, 20:22
Joined
Apr 11, 2008
Messages
13
I need to be able to copy a series of records from a set of related tables.Tables are related as below:
1 EventSeries (tblEventSeries - Primary key SeriesID) ->
1 to Many Events for each EventSeries ( tblEvents - Related key SeriesID, Primary key EventID) -> The event details can be different for each event
1 to Many EventtResources for each Event (tblEventResources - Related keys SeriesID , EventID, Primary Key ResourceID) Resources can vary for each event.

I want to copy the contents of each table, but with a new SeriesID, & new related EventID's but the same ResourceID's as the resources will remain the same. It is the SeriesEvent and Event details that will be new but with same of the orginal data reused, but not for instance the same client , clientref num or event names.I am succesfully copying records on my previous version which didn't have the tblSeriesEvent element to the database, but with the new version I just cannot get the tblEventResouces to copy the correct reords for each tblEvent related to the tblEventSeries.
Somehow I need to retain the tblEvent EventID's from the original EventSeries and append them to the tblEventresources, but with the new related EventID & SeriesID.

Any help would be really appreciated.

Regardsalalthwell
 
Last edited:

Users who are viewing this thread

Back
Top Bottom