Forum Discussion
Newbie Question: Form to populate a Link Table.
I am constructing a database to track the fuse inventory in my department, and I am cross referencing the fuse size/rating to the machine(s) that use that fuse.
I have a Link Table set up to track the many-to-many relationships, and have confirmed that I can use the table to get a list of fuses, with the machines that use the fuse, and a list of machines, with the fuses that are in the machine.
My current headache is in populating the Link Table. I have been doing it 'by hand,' manually entering the Primary Key for the machine and the Primary Key for the fuse into the Link Table.
What I would like is a form where I can select the machine from drop-down list A, select the fuse from drop-down list B and hit the 'add fuse' button to append the data pair to the Link Table.
Any advice will be humbly accepted.
Thank you all for your time and attention.
- File > New and download the Northwind sample app.
Look at the database design: Orders 1:M OrderDetails M:1 Products
Then look at how this M:M is implemented in OrderDetails form: Orders are on the parent form, there is a subform with OrderDetails, and a dropdown with Products.
3 Replies
- Tom_van_StiphoutIron ContributorFile > New and download the Northwind sample app.
Look at the database design: Orders 1:M OrderDetails M:1 Products
Then look at how this M:M is implemented in OrderDetails form: Orders are on the parent form, there is a subform with OrderDetails, and a dropdown with Products.- AndrewDreaslerCopper Contributor
Ah, subforms, that's the technique I should use. Thank you.
I already use subforms in my Project Log database, so the timestamped note entries are automatically attached to the project number, but that was a one-to-many relation. I did not realize the same technique could be used on a many-to-many link table.
- AndrewDreaslerCopper ContributorAn update.
My first form/subform setup for this used the Link Table as its base for both parts. It worked, but I had a copy of the machine-level form for every fuse listed for that machine, with all the listed fuses on each machine-level form.
My second attempt used the Machine Table as the base for the main form, and the Link Table for the subform, and then I got a sane response: one form per machine, all fuses for that machine listed in the ( continuous form) subform.
Thank you again for your help, Tom.