many to many relationship

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I have two tables, tableA and tableB, they have a many to many relationship
so i have a third table tabelAB.
Now I want to create a form where i choose from a combobox from tableA, and
under that I whant to have a subform where information in tableB, connected
through tableAB shows.
Hope some out there can help me
 
It would help if you say something about the real-world data you are trying
to organize, and a bit more about your database's structure. The junction
table in a many-to-many relationship needs to have fields that are related
to the primary keys in the other two tables. Typically the main form will
be based on one of the tables, the subform will be based on the junction
table, and a combo box on the subform will be based on the third table.
 
The RecordSource for the MainForm should be based on tblA (or a query based
on tblA. The RecordSource for the Subform is a Query combining tblAB and
tblB. This Query provides the ForeignKey Field(s) from tblAB to tblA which
you can use as the LinkChildFields for the Subform to go with the PrimaryKey
(being used as the LinkMasterFields) in the MainForm.
 
Back
Top