Can't understand what's wrong

D

DAnte

I am pretty much a newbie and I am trying to design a
database but I am a little confused about how I am
designing things. It is my understanding that if I want a
many-to-many relationship between two tables I generally
need to develop two one-to-many relationships with
a "junction" table in which the primary key from both of
these tables is the primary key for the junction table. I
have created a primary key in both of these tables that
consist of multiple fields, but I am wondering if an
autonumber field would be sufficient. I would like to be
able to update the two tables using a form and a subform.
When I create the subform using the subform wizard it asks
me for link fields which almost seems like it defeats the
purpose of having a relationship between tables and when I
modify these two tables no data is being updated in the
junction table. Even though I am modifying these two
particular tables do I still have to enter the data into
the junction table? I have tried to setup databases with
access several times before but I guess I don't quite
understand the concept of a relational database. It is my
thinking that when you set up a relationship between
tables and modify one table it automatically updates
related tables. For instance if I have an autonumber
field in one table and an autonumber field in a related
table with a one-to-many relationship then if I add a
record to the table on the one side then it will
automatically add the information in the related field to
the table on the many side. Is my thinking way off on
this? (I am pretty sure it is) What is the best way to set
up a form pulling data from tables that contain a many-to-
many relationship?
 
D

Duane Hookom

I always use Autonumbers as primary keys.

When you add a record to the "one" side, it will never automatically add a
record to the many side. Not every parent record will have child records.

The method for maintaining these relationships is to place the "one" side in
a main form and the "junction" table in the subform. Set the Link
Master/Child properties of the subform to the common field.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top