Same Primary Key in Different Tables

  • Thread starter Thread starter SactoGal
  • Start date Start date
S

SactoGal

I'm new to Access and using Access 2003. I'm setting up my tables and have 2
questions. 1) I have a table for customer names. I set up Customer ID with
Autonumber as the primary key. I want to use Customer ID in another table
again as the primary key. Do I set it with Autonumber again or set it to
Numerial? 2) If I use an input form to create a new customer, how does
Customer ID actually get created? Thanks in advance for your help.
 
To use the same CustomerID as primary key in another table, use a field of
type Number.

When you create a relation between your 2 tables (in the Relationships
window), this will give you a one-to-one relation, since the field is unique
in both tables.

You do not automatically get a record inserted into the related table when
you add a new customer to your main table. You can program it in the
AfterInsert event procedure of the form where you enter customers if you
have a reason to do so.

Before you get that far, it might be worth considering whether you are
actually creating a design that is correctly normalized. There are some
cases where what you are doing could be right, but if you are only doing
this because Access won't let you have more than 255 fields in your Customer
table, the design is not right.
 
Lazy. moronic, rude and inconsiderate top-posting fixed.
it might be worth considering whether you are actually creating a design
that is correctly normalized.

LMAO
 
Back
Top