This database is in a very preliminary state. I have 2 tables with a primary key and a linking table which use the primary keys of the first 2 tables as its primary key. I want to be able to examine all the ingredients, in the ingredients table, that are associated with which ever recipe I have chosen. I know I am doing something wrong with what I pick as the source for the IngForm and think it should be a SQL query of some kind but I do not know how to construct it. Can someone look at my work and tell me what I need to do, and explain why.
Question.odb (15.1 KB)
You will need a subform with a listbox to set b:m-relationship.
Have a look for the example form:
Question.odb (24.8 KB)
About the query I think it should be something like
SELECT "R"."RecpID" AS "r", "I"."IngredientName", "RI"."Count" AS "q"
FROM "tblRecipe" AS "R"
JOIN "tblLinkRectoIngr" AS "RI" ON "R"."RecpID" = "RI"."RecpID"
JOIN "tblIngredient" AS "I" ON "RI"."IngID" = "I"."IngID"
It shows the ingredients and quantities, and the RecpID for linkage main - subform.
Solution with 2 Table Controls:
Of course I think solution based on ListBox will be much more elegant.