I've built a very simple Bill of Material database that has a many-to-many
relationship between two main tables: tblQWMaster and tblPartNo. There is an intersecting table called tblQWParts. The intesecting table also has a field called QtyUsed and some price fields that are calculated. The concept is that every co ponent (Part Number) could be in many Assemblies (QWMaster) and many Assemblies could have many Part Numbers. This DB uses tables that are already populated with data (you don't enter a line of information to match to another record other thanQtyUsed). I've tested the relationships and everything works as it's supposed to when mannually connected by putting the ID (Primary Key) numbers of one the PartNumbers into more than one of the QWParts intersecting table and entering a QtyUsed. I've built queries that
list both matched (linked) and unmatched records and they work great showing all the info I need.
Here's the question: I have a Mainform called frmQWMasterEdit with two
subforms. The top of the main form shows one Assembly record and it's
description and ID number. The first subform below that shows matched
(linked) parts that are already linked to the Assembly at the top of the form. Below this subform is another subform that is not linked to the Assembly at the top and displays all available (unmatched or not linked) Part Numbers. This second subform gets it's information from a query that has both PartNumbers and QWParts with both ID fields and QtyUsed in this query (and subform) What I want to do is enter a quantity in the QtyUsed field on the second subform and click a button I've added that says Add and have the ID number (PartNoID) of the PartNumber line populate the field in the intersecting table and enter the quantity I've entered into the QtyUsed field in the intersecting table then requery. Hopefully the item will show up in the first subform since it now match es (linked) and the number selected dissappears from the second subform since it's now matched. I attached a screenshot of the form.
I'm not good at VBA yet... I'm trying to learn but not sure how to make this happen. Can anyone lend a hand?