Duplicate records of subform based on main form

B

Ben

I have a subform that i need to duplicate records for but duplicate them to a
new set of records based on the main form.

Main Form Name is WAR
SubForm name is WebFarm
SubForm of WebFarm is WebFarmAIs

If the user goes to the subform of WebFarm and adds data in that subform,
that works. What doesn't work is pulling the WebFarmAIs subform data into
that new record.

Need help
 
J

John W. Vinson

I have a subform that i need to duplicate records for but duplicate them to a
new set of records based on the main form.

Main Form Name is WAR
SubForm name is WebFarm
SubForm of WebFarm is WebFarmAIs

If the user goes to the subform of WebFarm and adds data in that subform,
that works. What doesn't work is pulling the WebFarmAIs subform data into
that new record.

Need help

What are the Recordsource properties of the three forms? What tables, in other
words? What are the relationships between the tables, and the Master and Child
Link Fields of the subforms?

If you're trying to store the *same* data redundantly in two or more tables...
don't!
 
B

Ben

WAR Table:
WarID = Autonumber (PK)
StartDate - Date/Time
EndDate - Date/Time

WebFarm Table:
WebFarmID - Autonumber (PK)
Phase1Date - Date/Time
Phase2Date - Date/Time
Phase3Date - Date/Time
Phase4/Date - Date/Time
Phase1Status - Text
Phase2Status - Text
Phase3Status - Text
Phase4Status - Text
WARFK - Number

WebFarmAIs Table
WebFarmAIsID - Autonumber (PK)
ActionItem - Text (255 char)
Owner - Text
WebFarmFK - Number (FK to WebFarm Table)

I have created a form called WebFarm and put a subform of WebFarmAIs on it.
I want to be able to be on a new record for WebFarm and click a button that
pulls the previous record's WebFarmAIs data into that WebFarm record.

Any ideas?
 
J

John W. Vinson

WAR Table:
WarID = Autonumber (PK)
StartDate - Date/Time
EndDate - Date/Time

WebFarm Table:
WebFarmID - Autonumber (PK)
Phase1Date - Date/Time
Phase2Date - Date/Time
Phase3Date - Date/Time
Phase4/Date - Date/Time
Phase1Status - Text
Phase2Status - Text
Phase3Status - Text
Phase4Status - Text
WARFK - Number

Even *if* there will ALWAYS be exactly four phases, no more, no fewer, never
under any circumstances five... this table is incorrectly designed. YOu have a
One (webfarm) to many (phase) relationship embedded in each record.
WebFarmAIs Table
WebFarmAIsID - Autonumber (PK)
ActionItem - Text (255 char)
Owner - Text
WebFarmFK - Number (FK to WebFarm Table)

I have created a form called WebFarm and put a subform of WebFarmAIs on it.
I want to be able to be on a new record for WebFarm and click a button that
pulls the previous record's WebFarmAIs data into that WebFarm record.

Now you've lost me. The WebFarm table does not contain fields for ActionItem
or Owner. What is the "previous record"? What do you want to "pull"?

Guessing in the dark here... you can set the DefaultValue property of the
controls on the sub-subform to their current value in each control's
AfterUpdate event, so that when you add a new record the value defaults to the
previous value. But since there's a one to many relationship between WebFarm
and WebFarmID (right???) this will apply to all the records for an individual
WebFarmID, not just to new WebFarms.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top