Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cascading 1

Status
Not open for further replies.

FastEddieB

Programmer
Jan 16, 2004
8
0
0
US
I have a cascading combo box issue. Actually it might be more of a relationship issue, so here goes.

I have a table with a list of components and a table with a list of sub-components. I want to set up cascading combo boxes, so that when you select a component, only the sub-components that pertain to that component shows up as an option.

Here's the rub. When setting up the relationship between the 2 tables, I realized that the sub-components can fall under serveral different components at the same time......

and I am not sure how to address this. If anyone could help out with this it would be greatly appreciated. I am under a time constraint to get this done.

Thanks
 
You need a link table

Components

ComponentID
ComponentName
etc

SubComponents

SubComponentID
SubComponentName
etc

ComponentsSubComponents

ComponentID
SubcomponentID

ComponentsSubComponents contains what subcomponents exist for a given component.

Craig
 
Thanks so much Craig..I am kind of a novice at this.....Just as I got the email for your posting, I was poking around in the Table and Relationships Forum and saw a similar reponse for someone else who had the same issue.

I love this web site....in just a small amount of time I have found numerous answers to a lot issues I have had.

Again, thanks a million
 
The only way I can think of is to have more than one entry for the same sub-component- not ideal but it would work. i.e. one table for main components, then a second table for the subcomponents. Main table has a primary key which is a foreign key in subcomponents, and in subcompenents the foreign key and subcomponent key are a compound key.

You would need to make an entry in subcomponents for each amin component category you want a sub to appear in.

Source for the second combo would then be all subcomponents where the main component ID = combo 1.

Don't know if this helps- someone who knows more than i do must have a better way!

Nigel
Didn't someone say work is supposed to be fun? They didn't have computers then I guess....
 
See- I said someone would have a better answer!!!

Nigel
Didn't someone say work is supposed to be fun? They didn't have computers then I guess....
 
This is one of those issues that many manufacturing businesses face on a daily basis, including ours. To get around this sort of issue, rather than directly linking sub components and components, from a DB stand point of view, you would do this differently. You will have 2 tables and probably more, but none the less, 2 basic tables at the minimal.

Your first basic table should be an Item Table. This table will list every single item that your manufacturing company uses rather if it's raw, supply (MRO), component, finish good, or some other type of item. This and supporting tables will contain the various information that's related to the different items.

Your second table should be a BOM (Bill Of Materials) Table. This and other supporting tables should contain data that deals with what item(s) gets converting into what item(s) and the various information such as how much/many of what to make how much/many of what.

Ronald R. Dodge, Jr.
Production Statistician
Master MOUS 2000
When the going gets tough, the tough gets going.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top