You cannot add or change a record because a related record is required in table 'MolT

  • Thread starter Thread starter dsigano
  • Start date Start date
D

dsigano

Guest
I am getting the following error message on my database:

You cannot add or change a record because a related record is required in table 'MolTable'

I have a table called MolTable and a table called AssayTable. One MolTable record will be linked to several AssayTable records. However, one AssayTable record will be linked to exactly one MolTable record. I also have a main form for the MolTable data that contains a subform for AssayTable data. When I try to add a new record to the assay table, I get the above error message. There already are several AssayTable records for each MolTable record. I was simply trying to add an additional AssayTable record to an existing MolTable record. Compound ID is a field in both tables that links them together. CoumpoundID is not the key field in either table however. Any ideas?

Thanks!
Dina
 
The value in the foreign key field does not match the primary key of an existing record. Check your form. Make sure the master/child links are properly set. Check the table definition. Make sure that the default for the foreign key field is not 0. Also make sure that the foreign key's required property is set to yes if the relationship is required (parent/child) and no if it is optional (a lookup).
 
One to One relationship problem

I know its quite a long time for this reply... but it will be a little more step towards the solution.

Your problem is a typical One to One relationship problem... basically arises out of proper lack of defnition of which is parent table and which one is child table...

when we create this specific relationship, we have to be carefull in where we pick and link it to where i.e what i'm trying to say is From table to To table(one to One) order is very important.

we have to start from the parent table to child table.. Then you would not get this error...

I hope i explained clearly... don't mind explaining it again....

coolmesh84
 

Users who are viewing this thread

Back
Top Bottom