View Single Post
  #9  
Old February 27th, 2010, 05:42 AM posted to microsoft.public.access.tablesdbdesign
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Part and Product Database Help

On Fri, 26 Feb 2010 19:56:01 -0800, mglg01
wrote:

Sorry but I'm kind of new with Access, so bear with me please. In your reply
you said :

"ProductParts
ProductID link to Products
PartNo link to Parts
any info about this part as it pertains to this product, e.g. number
needed"


What do you mean by link to Products? How do I link this? Also, I just
want to make sure I am doing this right. Since each product can have many
parts, that means I am going to have records in the ProductParts Table that
goes something like this, correct?:

Product ID PartNo
A41 013
A41 014
A41 017

Am I understanding this right? Sorry that this is completely basic stuff,
but like I said I am just starting with Access and still learning


The Product ID (I'd name it ProductID, blanks in fieldnames can cause annoying
hassles) is the "link to products", also known as the "foreign key field".

The ProductParts table should (I'd say must) have a Primary Key, but if there
are no relations from it going on to yet additional tables, that Primary Key
can consist of the two fields ProductID and PartNo. In table design view,
ctrl-click both fields so they are both highlighted and click the Key icon;
this will allow multiple parts for each product, and multiple products for
each part, but will prevent you from entering the same product-part
combination twice. If an Doohicky product requires six Gizmo parts, you may
want to include a Quantity field; if, on the other hand, you want to uniquely
keep track of each individual part, even if there are multiple instances of a
PartNo, then you will need an additional field (an Autonumber primary key
might be simplest).
--

John W. Vinson [MVP]