Automatically update a FK when a PK is updated

G

Guest

Is it possible to make a FK in a child table update when the parent table has
a new record added. I'm looking to have the child FK updated when a Parent PK
is increased via autonumbering?

If this is possible, can you provide the code?
 
G

Guest

Hi Nanette,

If you have the child table in a subform, and the parent table in the main
form with the field linking set correctly, Access will handle this
automatically for you.

If you are inserting a record a different way, you will need to insert the
key yourself.

Hope that helps.

Damian.
 
G

Guest

Damian,

What is field linking?

Damian S said:
Hi Nanette,

If you have the child table in a subform, and the parent table in the main
form with the field linking set correctly, Access will handle this
automatically for you.

If you are inserting a record a different way, you will need to insert the
key yourself.

Hope that helps.

Damian.
 
G

Guest

The bit on your form/subform that specifies which field on your main form is
the primary key, and which field in your subform is the foreign key. Setting
these correctly will make Access handle your issue for you.

The field linking bits reside on the Data tab of the properties box of the
subform control on your main form.

Damian.
 

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