problem with planning database + creation of forms

bogushs

Registered User.
Local time
Today, 05:51
Joined
May 4, 2005
Messages
27
Hi guys
Quick question. im running a planning database which has got 3 tables Objectors, Representations and Agents. Ive put these together using a one-to-many join matching up the index fields from Objectors and Representations. Ive just constructed a form which has a main form being the Representations and the sub forms with Objectors and Agents. When I want to update or add records a message saying " you cannot add or change a record because a related records is required in table Objectors.

Can any one tell me how I can get around this or possible solutions to this is? Any comments or feedback greatly appreciated!

Cheers
 
bogushs said:
Hi guys
Quick question. im running a planning database which has got 3 tables Objectors, Representations and Agents. Ive put these together using a one-to-many join matching up the index fields from Objectors and Representations. Ive just constructed a form which has a main form being the Representations and the sub forms with Objectors and Agents. When I want to update or add records a message saying " you cannot add or change a record because a related records is required in table Objectors.

Can any one tell me how I can get around this or possible solutions to this is? Any comments or feedback greatly appreciated!

Cheers

Publish the database as an attachment and i will have a look for you

Alastair
 
you cannot add or change a record because a related records is required in table Objectors.

This is a "Relational Integrity" message telling you that you tried to put the cart before the horse.

You are creating a set of tables with parent/child relationships. This is a very useful mental picture in several ways. In this case the analogy is very good. Access is telling you that you cannot have a child without parents.

What you did was try to enter data in the wrong order based on the relationships you defined, because it is those relationships that define which table is parent and which table is child. Access is telling you that your Objectors table is the parent and the data you tried to enter corresponds to no known Objector.
 
Could just mean that you did not set the parent/child relationship in the properties for the subform.
 
The third common cause of this problem is leaving 0 as the default for foreign key fields. If you don't actually choose a value from a combo or type in the key value, Access defaults to whatever the form or table default says. Unless you remove it, 0 will be the default for numeric fields so be careful when you create foreign key fields in tables.
 

Users who are viewing this thread

Back
Top Bottom