M
Miles
I am getting a referential error problem that is confounding me. There is
something obvious here that I am missing. I am using Access 2003. The form
that I developed is based on a query with 3 tables, as shown (in simplified
form):
1. tblPersonMain
PersonID - PK (autonumber)
Gender - text
2 tblPersonFamily
PersonFamilyID - PK (autonumber)
PersonID - FK (required, no duplicates)
Notes on Family - memo
3. tblFirstNames
FirstNameID - PK (autonumber)
PersonFamilyID - FK (required, duplicates ok)
PersonFirstName - text
The link is 1 to 1 between tblPersonMain and tblPersonFamily
The link is 1 to many between tblPersonFamily and tblFirstNames
If I set the form's RecordsetType property to Dynaset I can't update the
data in the fields from tables 2 and 3, so I set the RecordsetType property
to Dynaset (inconsistent updates).
On the joins between tables 1&2 and between 2&3 I have ticked referential
integrity with Cascade Updates and Cascade Deletes.
The database is empty. When I try to save the record, I get error 3201 "You
cannot add or change a record because a related record is required in table
'tblPersonMain' ".
It seems that no PK is being populated in tblPersonMain and then being
picked up by tblePersonFamily as a FK.
What can I do to make this work? I don't want to redesign my form to
include subforms (assuming that would even work) and I don't want to untick
referential integrity on the joins between the tables (which seems to work,
but will it mess up my data later?).
Any help would be appreciated.
Miles.
something obvious here that I am missing. I am using Access 2003. The form
that I developed is based on a query with 3 tables, as shown (in simplified
form):
1. tblPersonMain
PersonID - PK (autonumber)
Gender - text
2 tblPersonFamily
PersonFamilyID - PK (autonumber)
PersonID - FK (required, no duplicates)
Notes on Family - memo
3. tblFirstNames
FirstNameID - PK (autonumber)
PersonFamilyID - FK (required, duplicates ok)
PersonFirstName - text
The link is 1 to 1 between tblPersonMain and tblPersonFamily
The link is 1 to many between tblPersonFamily and tblFirstNames
If I set the form's RecordsetType property to Dynaset I can't update the
data in the fields from tables 2 and 3, so I set the RecordsetType property
to Dynaset (inconsistent updates).
On the joins between tables 1&2 and between 2&3 I have ticked referential
integrity with Cascade Updates and Cascade Deletes.
The database is empty. When I try to save the record, I get error 3201 "You
cannot add or change a record because a related record is required in table
'tblPersonMain' ".
It seems that no PK is being populated in tblPersonMain and then being
picked up by tblePersonFamily as a FK.
What can I do to make this work? I don't want to redesign my form to
include subforms (assuming that would even work) and I don't want to untick
referential integrity on the joins between the tables (which seems to work,
but will it mess up my data later?).
Any help would be appreciated.
Miles.