Referential Integrity Problems

  • Thread starter georgeg via AccessMonster.com
  • Start date
G

georgeg via AccessMonster.com

I have two child tables that I need to set referential integrity. I have
gone to tools, relationships, set the PK from the master to the (non PK
fileds) in each of the child tables. I open a form (using the master table)
and fill it out. I then pess a button to open another form using one of the
child tables. I am expecting to see the value of the PK field (being used
for referential integrity) to show up in the child form. It does not appear,
thus no relationships, my problem.

When I look at the actual tables, the value of the PK field in the master
table has not transfered to the record of the child table. I've checked the
fields in each of the tables, they are numbers, long integers. In the master
table it is indexed no duplicates, and it is a required field. In the child
tables it is indexed, duplicates are OK and not required.

At this point I am unable to see the forest through the trees. Thanks for the
help.
 
G

Guest

What you want will only happen automatically if you have a form and subform
built upon this relationship. Also if you don't put any data into the child
table, no record is created there.

A One-to-Many relationship means that the child table can have many, one, or
no records related to the parent table. With RI there must be a matching
parent record for records in the child table.
 
G

Guest

In the child tables it is indexed, duplicates are OK and not required.
It needs to be a required field otherwise it will not relate to anything.
When I look at the actual tables, the value of the PK field in the master table has not transfered to the record of the child table.
It sounds like you do not have referential integrity is set.
I then pess a button to open another form using one of the child tables.
As Jerry Whittle said you need to use a subform. When you insert the
subform then set the Master/Child links to the PK/FK field. Forms must be
related, not just the underlying data tables.

When you create a new record in the subform it will insert the key field
automatically.
 

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