tables not linking properly

Y

yorkielover02

I have two tables. both with store id fields that i would like to link the
two tables together by. At this point there is a one to many relationship
that should allow for anytime a new store is added that store id is added to
the it table. At this time anytime i add a new store id to the store table it
is not creating a new store in the it table. Any ideas as to why?
 
A

Al Campagna

yorkielover02,
You can't maintain relationships by directly editing tables.
That the job of a form, which maintains both tables as data is
entered. Working directly with related table/s is will not work.

Create a form, the main part of which will be based on your primary
table (the ONE table).
Create a subform, based on the related table (the MANY table).
Besides relating them in Relationships, relate them on the form by using
the Parent/Child link.
Now, whenever you add a new ONE store, the subform will be ready to
accept realted MANY records... whether you enter any now... or later.
--
hth
Al Campagna
Microsoft Access MVP 2007-2009
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
K

KARL DEWEY

You seem to have a 'store' table and 'it table'. I assume that the 'store'
table is the one side and that is where you are adding a new record and
expecting it also to appear in the 'it table'. One-to-many relationships do
not work that way.

You also can not add to the many side without first having a record on the
one side.

Maybe I misunderstood you, if so then try and explain it another way for me.
 
J

John W. Vinson

I have two tables. both with store id fields that i would like to link the
two tables together by.

Is the StoreID an Autonumber in both tables? If so, it will NOT WORK for what
you're proposing.
At this point there is a one to many relationship
that should allow for anytime a new store is added that store id is added to
the it table. At this time anytime i add a new store id to the store table it
is not creating a new store in the it table. Any ideas as to why?

Relationships don't work that way: a relationship will *prevent* an invalid
record from being added, but it won't (and needn't and shouldn't)
automagically create a new record. What is the "it" table? What information is
stored in the stores table, and what is in this table? What real-life "entity"
(person, thing, or event) does each table model? More info please!
 
M

Melissa Brown

Maybe I have been reading too long, but which should be the 'one' table? My
example: cuptomers making annula reservations. Is the customer the one table?
should the 'many' be the reservations? or vice versa? The reservations
change, the customer stays the same. If I am making a form for reservations,
does that make the customer the parent on the form or is the reservation form
the parent and then the customer the child?

Help. Al.
 
J

John W. Vinson

On Mon, 12 Apr 2010 12:40:01 -0700, Melissa Brown <Melissa
Maybe I have been reading too long, but which should be the 'one' table? My
example: cuptomers making annula reservations. Is the customer the one table?
should the 'many' be the reservations? or vice versa? The reservations
change, the customer stays the same. If I am making a form for reservations,
does that make the customer the parent on the form or is the reservation form
the parent and then the customer the child?

Each customer may have zero, one, two or many reservations.
Each reservation pertains to one and only one customer.

Customers are the "one" side, reservations the "many" - because one Customer
may have many Reservations, but one Reservation applies to only one customer.
 

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