Master-Detail Forms with Many to Many relationships

Master-Detail Forms with Many to Many relationships

Post by ECathel » Wed, 20 Apr 2005 03:09:05


This is a multi-part message in MIME format.


I have 3 tables in a Many to Many relationship.

Recipe
RecipeDetail
Ingredients

Recipe detail has 3 fields:RecipeID,IngredientID,Ingredient Count

How do I setup my master detail form to handle this? Most of the tutorials I have seen deal with a singel parent-child relationship. I want to see the ingredients and the count of each within the detail form.

--
--Eric Cathell, MCSA
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2627" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV>I have 3 tables in a Many to Many relationship.</DIV>
<DIV> </DIV>
<DIV>Recipe</DIV>
<DIV>RecipeDetail</DIV>
<DIV>Ingredients</DIV>
<DIV> </DIV>
<DIV>Recipe detail has 3 fields:RecipeID,IngredientID,Ingredient Count</DIV>
<DIV> </DIV>
<DIV>How do I setup my master detail form to handle this? Most of the tutorials
I have seen deal with a singel parent-child relationship. I want to see the
ingredients and the count of each within the detail form. </DIV>
<DIV><BR>-- <BR>--Eric Cathell, MCSA</DIV></BODY></HTML>
 
 
 

Master-Detail Forms with Many to Many relationships

Post by Frans Boum » Wed, 20 Apr 2005 17:40:14


As the m:n relation is an objectified relation (i.e.: the intermediate
table is used as a separate entity), the setup is master - detail and
then a view of the ingredient chosen, as you have to use the
intermediate entities (RecipeDetail). As recipeDetail has an m:1
relation with Ingredients, the ingredients aren't viewable in a grid.

So master is Recipe, then you have a detail view for that current
recipe, in which you show RecipeDetail. For the selected recipe detail
you show the related ingredient in labels or textboxes below that.

You can also opt for a master-detailed view but hten you have to join
the ingredient with recipe detail and show the join result in the
detailed view.

Frans

--
------------------------------------------------------------------------
Get LLBLGen Pro, productive O/R mapping for .NET: http://www.yqcomputer.com/
My .NET blog: http://www.yqcomputer.com/
Microsoft MVP (C#)
------------------------------------------------------------------------