----- Original Message ----- From: "Jillian Carroll" <[EMAIL PROTECTED]> > As a technician, you pull up the wrench used for removing alternators from a > 1997 Ford Taurus. When you pull up this wrench, you also see a list of > 'related tools' that are also used/required for removing alternators from a > 1997 Ford Taurus. > > My problem is that there are thousands of tools in the database and there > could be any number of 'what's related' tools for a single tool. > > How can I create a dialogue for easily adding 'what's related' tools? ----------------------------
So your difficulty is in creating the relationships? You seem to be saying, from the last part here, that you want to select a tool, and then select tools related to it from a list, only there are thousands to choose from. Surely this list could be narrowed down a lot with some of the tools' basic attributes. E.g., I assume each tool already has a relationship to a vehicle (assuming its just vehicle maintenance tools). Some more information on what's info is stored already for each tool would be helpful in envisioning this. Your example makes me think you should have the following DB tables: - tools Records of actual physical tools: toolID (PK) toolTypeID (FK) componentID (FK - assuming each tool only used for one component - otherwise use a linking table for one-to-many or many-to-many relationships) notes (text) [whatever other fields] - toolTypes e.g. wrench: toolTypeID (PK) toolType (text) - vehicles e.g. 1997 Ford Taurus: vehicleID (PK) vehicleManufacturerID (FK) vehicleModel (text) vehicleYear - vehicleManufacturers e.g. Ford vehicleManufacturerID (PK) vehicleManufacturer (text) - components Different types of components for vehicles, e.g. alternator: componentID (PK) component (text) - toolActions Not sure about this - could you described all possible tool actions, e.g. remove? toolActionID (PK) toolAction (text) - vehicleTools This would tie it all up, relating each tool to one or more vehicles and one or more actions: toolID (FK) vehicleID (FK) toolActionID (FK) This is just off the top of my head, it's probably not a water-tight schema. My guess is, though, that you've got a legacy database that you're trying to make sense of. Maybe some work normalising the DB would provide you with the relationships you need? Gyrus [EMAIL PROTECTED] work: http://www.tengai.co.uk play: http://www.norlonto.net PGP key available ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm