Subform entry not linked to parent form's one

  • Thread starter Thread starter Greg
  • Start date Start date
G

Greg

Hi,

I developped a small database to store information about flats for sell :
each flat is linked to a real estate (if any), using a foreign key in the
appartment table ; both appartement and real estate identifier columns are
primary keys.
I also made up forms for each kind of object and included real estate form
within the appartment form as a subform, with form parent & subform child
fields set up accordingly.

My problem is this one : I cant' manage to create a new real estate from
within the subform located in the appartment form. As soon as I'm trying to
type a new real estate name, the system sends me a warning saying I'm trying
to write NULL in a non VARIANT variable ; if I ignore the message and go on
typing and validating, the new real estate is created but is not linked to
the appartment it should be linked to.
I can't even choose a real estate for a given flat since the browsing arrows
are grayed, except when I have linked them directly from the table view.

I just can't figure out why it is not working ; I was using another
database, using the same kind of relationships and subforms, on Windows 2000
and it was working fine. I am now working on XP and even this other databse
is not working anymore ...
My Office XP version is up to date, with SP1 & SP2 installed.

Sorry if the question has been already asked, but I could not read any
question related to this particular subject ...

Thank you for your answer,
Gregory.
 
If an apartment sale can be promoted through 2 or more real-estate agents,
you may have a more fundamental problem here: your Tables are set up as One
(RE agent) to Many (Apartments) while you really need a Many (RE
Agents)-to-Many (Apartments). From the way you set up your Form (and the
usual practice in real life), it sounds like you want Many-to-Many
relationship.

In this case, you need to re-design the Table Structure to allow for the
M-to-M relationship.

Check Access Help on Many-to-Many relationships.
 
In this case the normal set up is that the REAgent Form is the *main* Form
and the Apartment Form is the Subform (can be in NormalView or CtsFormView)
since the relationship is ONE REAgent to MANY Apartments.
 
Back
Top