Am I missing the point?

  • Thread starter Thread starter craig
  • Start date Start date
C

craig

If I have 4 tables containing various data, each table
has a primary key called RUN NUMBER. If I link them
together in the relationship table via the RUN NUMBER
would it make sense that when I created a new RUN NUMBER
in one table it would replicate in the other 3?

If I base a query on each of the tables, and created a
form from each query,if I created a new RUN NUMBER in one
of the forms would it show in the other forms if the
table were all linked?

Do I need to link the Queries?

Would the query link's be linked as a foreign key?

Or am I very confused.
 
Hi,
No, the RUN NUMBER does not get added automatically to all
tables just because you set up relationships. It will get added if you have
a form/subform setup with the RUN NUMBER as the linking field.

Are these all one to many relationships?
 
Yes, they are all one to many relationships. If the forms
are based on Queries can I use those as a basis for a
subform?

Craig.
-----Original Message-----
Hi,
No, the RUN NUMBER does not get added automatically to all
tables just because you set up relationships. It will get added if you have
a form/subform setup with the RUN NUMBER as the linking field.

Are these all one to many relationships?

--
HTH
Dan Artuso, Access MVP


"craig" <[email protected]> wrote in
message news:[email protected]...
 
If I have 4 tables containing various data, each table
has a primary key called RUN NUMBER. If I link them
together in the relationship table via the RUN NUMBER
would it make sense that when I created a new RUN NUMBER
in one table it would replicate in the other 3?

No, it does not. A Relationship constrains the value which can be
added, ensuring that you can't add a record that DOESN'T match - it
doesn't (and shouldn't!) create empty "placeholder" records.
If I base a query on each of the tables, and created a
form from each query,if I created a new RUN NUMBER in one
of the forms would it show in the other forms if the
table were all linked?
No.

Do I need to link the Queries?

Would the query link's be linked as a foreign key?

You will need foreign keys, yes.
Or am I very confused.

So it would appear.

If you're relating these tables Primary Key to Primary Key, then you
are creating one-to-one relationships, since the Primary Key is (by
definition) unique in each table. One to one relationships are quite
rare! Normally you would have one-to-many relationships, joining the
RunNumber in the "one" side table to a RunNumber field, which is NOT
the primary key, in the "many" side table. The "many" side tables
would each have their own primary key, which might be one or more than
one field.

Normally the way you enter data into related tables is to use a Form
based on the "one" side table, with a subform based on the "many" side
table. The primary key of the "one" side table would be the Master
Link Field of the subform, and the foreign key field the Child Link
Field. When you create a record on the subform (but not before),
Access will copy the value from the currently selected record's
primary key into the related table's foreign key field.
 
Back
Top