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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

copying over sibling records in datasheet view?

Status
Not open for further replies.

ugly

Programmer
Jul 5, 2002
70
0
0
GB
My database has two tables, units and components. Units and components have a M:M relationship and are linked through a junction table. I have created a form where unit and components are shown as datasheets. If you click on a unit the corresponding components are shown on the component datasheet.
I can copy and paste a unit record to form the basis for a new unit entry. What I would like is for attached components to also be copied over in the process. So how do I copy a unit and its attached components over to a new unit entry?
 
You will have to write an append query to do it and then in code execute it and requery the correct form.

Experience tells me that a copy paste copies the text values out of controls and pastes them so if combo boxes display different text than the key, the paste may not end up with the same key. Also the copy and paste seems to happen right to left (important as I had multple comboboxes bound to the same field with the first one, left, not being the key which caused a key change).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top