Fresh Start - Cannot add data to "Child Table"


G

Guest

Parent Table

PKey - ParentTable_ID - Autonumber - Long Integer - Incremental
Field 1
Field 2
ETC

Child Table

PKey - ChildTable_ID - Autonumber - Long Integer - Incremental
FKey - ParentTable_ID - Number - Long Integer
Field1
Field2
Field3
Field4

The four fields are indexed "Yes (duplicates allowed)

The Parent related to the Child One Parent to many Children
PKey Parent to FKey Child

I created subform based on Child Table and added to Main Form based on the
Parent....When I try to add data in the subform I get the following message.

The changes you requested to the table were not successful because they
would creat duplicate values in the index, primary key, or relationship.
Change the data in the field...........etc.
All suggestions appreciated. Thank you.
 
Ad

Advertisements

A

Allen Browne

Open the child table in design view.
Select the foreign key field.
Make sure there is nothing in the Default Value property.

Access assigns a zero as the default for numeric fields - not very useful
for FK fields.
 
G

Guest

You are correct about the "0". That still doesn't solve the problem. I have
tried linking the main form to the sub form by both the ParentID to ChildID
and ParentID to ChildFkey also.
 
Ad

Advertisements

L

Lynn Trapp

Jeff,
If you keep starting new threads about this problem, you are going to have
the entire internet confused... <g>
 

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