Sub form Help

ajentp

Registered User.
Local time
Today, 04:55
Joined
Nov 4, 2008
Messages
12
It is a very beginner question about SUb form. I am trying to make a sub form to show records of merchandise on the main form and their available color in the sub form. I am able to create the form but not able to connect each item with correct color.

The main form (FormFromQuery) and sub form (Table1 Query subform1) are run on query (Table1 Query). I am downloading this here.

Please help me. Let me know what I am doing worng.

Thank You.
 

Attachments

Here're some ideas.
I think you are working with a many-to-many relationship. You have multiple items and multiple colors, and each of these needs it's own table. But in addition, you need another table, say tItemColor, that connects one item with multiple colors or one color with multiple items as the case may be.

I've added five objects to your database: tItem, tColor, tItemColor, fItem, and fItemColorDS. Apart from these, check out the relationships I've defined for the tables. Check out how the subform is connected to main form, particularly the LinkMasterFields and LinkChildFields properties of the subform control--find them on the 'data' tab of the property sheet of the subform control. Note that the fields on which forms are linked must appear on the forms or there can be no link.

Many-to-many relationhips are tricky, so if your brain feels like melted cheese you are on the right track. An intuitive example of this type of relationship is Students and Classes. One student has many classes. One class has many students. Modelling this problem requires three tables.

Hope this helps,
 

Attachments

Hello Lagbolt,

That was awesome. However for some reasons I could not view LinkMasterFields and LinkChildFields in the subform properties/under tab. All I see here under Data tab: Record source, filter, Order by, Allow filters, allow edit..... etc.

Any help please?

Thank You.


http://www.access-programmers.co.uk/forums/member.php?u=17565
 
Believe it or not. I can not see LinkMasterFields and LinkChildFields in the subform if it is already bonded. However If I add an undonded subform I can see them as long as it does not get bonded. Is there anything I am missing? I am using Version 2000.
 
You have to select the subform CONTAINER control (control on the main form that houses the subform on it) to find those properties.
 
You have to select the subform CONTAINER control (control on the main form that houses the subform on it) to find those properties.

Thank you very much. I finally found what you meant.
 

Users who are viewing this thread

Back
Top Bottom