From One-to-One to One-to-Many

J

Jeff C

I have two tables related one-2-one but as I add records to the 2nd table it
will become the many of a one-2-many relation. How do I do this?
 
N

Noozer

Jeff C said:
I have two tables related one-2-one but as I add records to the 2nd table it
will become the many of a one-2-many relation. How do I do this?

Don't use the "many" field as the primary key in it's table.
 
J

Jeff C

I have cut the fields (columns) out of the main table and used them to create
the second table. Using the relationship function and autonumber fields as
primary keys, Access made them a one-2-one. I used the second table as the
source for a subform but it will not let me add records. The "Many" is not
the key.
 
N

Noozer

Duplicates are not allowed in your linking fields, so it has to be a
one-to-one relationship.

That's all I can think of.
 
J

John Vinson

I have cut the fields (columns) out of the main table and used them to create
the second table. Using the relationship function and autonumber fields as
primary keys, Access made them a one-2-one. I used the second table as the
source for a subform but it will not let me add records. The "Many" is not
the key.

What fields exist in these two tables, and how are they related? You
should certainly NOT have the same fields in the "many" table as you
do in the "one"; and they should NOT be joined primary key to primary
key.

Instead, you should have the "one" side table containing a Primary Key
field (which might be an autonumber or might be one or more fields of
data in your table, whatever serves to uniquely identify a record).
This table would have fields representing attributes of the Entity
(real-life person, thing, or event) modeled by the one side table.

The "many" side table would have *one* field - the Foreign Key, it's
called - as a link to the Primary Key of the one side table. Its
datatype must match; if the Primary Key is an autonumber, it should be
a Long Integer, otherwise it should be the same datatype and size as
the primary key in the other table. This field should NOT be the
primary key of the many side table - it *CANNOT* be since the primary
key is, by definition, unique in the table. The other fields in this
table should be different fields than those in the "one" table, and
should apply to the Entity modeled by the second table.

John W. Vinson[MVP]
 
Top