You cannot add or change a record because a related record is required

david.paton

Registered User.
Local time
Today, 11:18
Joined
Jun 26, 2013
Messages
338
I have a problem and I can't figure how to fix it. I have made a database and I am not sure what I have done as I used to be able to enter new information easily but whenever I try and enter new records now, I get the message You cannot add or change a record because a related record is required in table 'relationship'. That field is not even required as I don't have that data for some records.

What do I need to do so that is no longer needed for every record? The form where I enter the information and is giving me the error is called Widow.

I have uploaded a copy of the database below.

Thanks,
Dave
 

Attachments

Perhaps you just need to remove the relationship in the relationships window
 
I would not remove the relationship. That is probably not the issue.

This is probably caused by a default value set. Probably zero (0). Access will do this automatically for numeric field data types.

Check the table and form control to be sure there is nothing in the default value.
 
Dave,

You forgot to include instructions on how to use your attached database and duplicate the issue.
 
Sorry about not including the instructions but it has suddenly started working today. I have no idea why but it works now.

Thanks anyway,
Dave
 
Dave,

I dug around in your original attachment. The issue is you have a default value of Zero (0) set for the field at the table level. As soon as I set it to be blank, everything worked like you wanted.

Otherwise during data entry, you can select something them blank it out. This will manually clear the default value of 0 for that record.
 
Dave,

I dug around in your original attachment. The issue is you have a default value of Zero (0) set for the field at the table level. As soon as I set it to be blank, everything worked like you wanted.
Can you tell us the name of the field.
 
Not where I can look at the database.

To find it, it will be a foreign key field that is part of the relationship that enforces referential integrity.
 

Users who are viewing this thread

Back
Top Bottom