foreign keys - updated

  • Thread starter Thread starter Josh
  • Start date Start date
J

Josh

I never said it's a one-to-one relationship
It's one-to-many.

Two Tables:

People: Address:

PeopleID --AddressID
Name / City
AddressID--- State

So I create an Address form that only has a City and a
State field. Then I create a People subform(datasheet
view) and stick it into the Address form.

Then in the People properties of the main form I said the
Link Child/Master fields to AddressID.

As far as I know that's all I needed to set up.
Apparently I'm missing something.

The record source of the main form is Address and the
record source of the subform is People. To answer your
question I'm aware when the new records are created but I
don't think it pertains - when the new People record is
created I want it to set the value of AddressID to
Address.AddressID.

I hope this is enough info, not sure what I'm missing
here.

Thanx
-Josh
Several tables in a one to one relationship? WHY!? If
you have more
than 255 fields and you're trying to do this to get
around that limit,
you're going the wrong way about it.
Well, you'll have to give us some more information. How
are these
tables related? What's the Recordsource of the main
table? of the
subform(s)? Are you aware that creating a record on the
mainform does
NOT create a new record on the subform - that record is
created when
you start entering data on the subform, not before?
 
I never said it's a one-to-one relationship
It's one-to-many.

Pardon my misinterpretation!
Two Tables:

People: Address:

PeopleID --AddressID
Name / City
AddressID--- State

Is PeopleID an Autonumber? And People.AddressID a Long Integer and
Address.AddressID an Autonumber?
So I create an Address form that only has a City and a
State field. Then I create a People subform(datasheet
view) and stick it into the Address form.
ok...

Then in the People properties of the main form I said the
Link Child/Master fields to AddressID.

sounds good...
As far as I know that's all I needed to set up.
Apparently I'm missing something.

That all looks correct to me! I'll have to go digging through old
messages to find your previous message (hint: it's a LOT easier if you
reply to a message in a thread rather than starting a new thread) to
find out exactly what's happening, but I don't see anything you've
done wrong!
 
So the question is - Why doesn't the foreign key get
automatically insertted? :(
-Josh
-----Original Message-----
Pardon my misinterpretation!


Is PeopleID an Autonumber? And People.AddressID a Long Integer and
Address.AddressID an Autonumber?

***Yes and Yes, they're both defaults***
 
Back
Top