Page 1 of 1

Cannot add a record because the foreign key value not exist in master table

Posted: Fri Aug 12, 2022 9:46 pm
by Martinus

I've got a problem.
I've got two tables: master table (animators) and detail table (projects). UserID from the master table is passed on to the detail table, so the records created by a user are selected and showed. It all works, view, list, edit options work, but when a given user wants to add a new record, somehow the UserID is not passed on to the add form. With the referential integrity option ON, I can't add another record, I get the error : You cannot add or update a record because the foreign key value does not exist in the master table 'animators'. It does not exist, the form field is empty because it is not passed on to the form... why? No idea. Can anybody help?


Re: Cannot add a record because the foreign key value not exist in master table

Posted: Sat Aug 13, 2022 8:44 am
by mobhar

Perhaps you have already selected another master record that does not related to the previous master record. You may try to logout and login again, and see whether this would help.


Re: Cannot add a record because the foreign key value not exist in master table

Posted: Sat Aug 13, 2022 9:12 am
by arbei

You may review your settings for Referential Integrity.


Re: Cannot add a record because the foreign key value not exist in master table

Posted: Tue Feb 28, 2023 4:44 pm
by ach8

I have used the 'Referential Integrity' setting. But I have the problem that key-value does not exist after doing a lookup in the details table. How do I lock the 'Foreign Key' from disappearing after doing a search in the details table so that it is not empty value?