View Full Version : Building a Assembly from parts


ACONRATH
03-01-2002, 09:28 AM
Hello all

I have been elected to make a small dbase at my work and have a question on form design.
We are putting together different parts to make an assembly, with tables for different types of parts
And one table of the assembly. The parts tables have a number of unique Values fields with a description field and an auto number as the prime key id.

I want to make a form That looks through the “part description field” via a combo box, then when a “part description” is selected its id number is inputted into the assembly table. I could use a hint as to where
To look for the technique to do this.

I have been Very much enjoying learning and building my 1st dbase , but the more I get into Access
The more I feel overwhelmed by it.

Thanks for reading my post The rookie
AlexC

David R
03-01-2002, 12:57 PM
"I have been elected.." I like that. Did you run unopposed, or did you have to use party money for ad time?

Anyway, it sounds like you're on the verge of breaking into one:many relationships.
Your main table will contain Assembly-specific information, such as name, design team, function, etc. Your parts should have their own "reference" table where master information on each part is stored. You can use this table to build your dropdown combo, which I'll get to in a moment.
Then an AssemblyDetail table will contain its own separate ID field (not the ID of the Assemblies or the Parts), and two other fields (perhaps more): AssemblyID, Long Integer or other compatible field with the PK of the Assembly table, and PartID, compatible with the PartID from the reference table. I would make these fields with the Lookup wizard to the other table, let Access do the grunt work. You may need fields like Quantity, Location, etc.
Open Tools>Relationships and draw connections between Assemblies.AssemblyID (the PK) and AssemblyDetails.AssemblyID (the foreign key, or FK). Enforce Referential Integrity and Cascade Update. Do the same thing with PartID. You should see a "1" near the Assembly table side and an infinity symbol "8" on its side" near the AssemblyDetails table side. Same with PartID.
Now your main Form will have the Assembly-specific fields on it, and you'll make a subform with the parts listed one after another, whether there's 2 parts or 20. I usually build the subform first so I know how big it is, then use the Insert Subform wizard to add it to my other form (again, let Access do the grunt work).

Hope that helps. Post back if you have further troubles.
David R