Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

copy a record and subrecords

Status
Not open for further replies.
Jan 14, 2002
143
US
How do you do this? Obviously the new subrecords need to have the new main records ID as its foregn key and not the old main record, so how is this done?

 
You've left your question open to about a 1000 interpretations. Using VBA this would just be a matter of a lot of easy code.

From a form:

-Read the current values
-Open a recordset and use the AddNew method to create a new main record.
-Assign the value of the new main ID to a variable.
-Read the value of each related records.
-Open a recordset and use the AddNew method to create a new related record and use the value for the main ID as the foreign key.

-------------------------------------
scking@arinc.com
Try to resolve problems independently
Then seek help among peers or experts
But TEST recommended solutions
-------------------------------------
 
Sorry for the vaguery- I was trying to keep it general since too much info sometimes confuses things. Thanks for the input. I'll give it a whirl with your outline.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top