I join between two tables with common field "Plot" .When I insert the new record in table2.. I got the error while saving the new records. The error is, Primary key cannot null. What should I do?
From your description, it seems the table1 would be the master and table2 the child. So first try inserting the values in Table1 and then to other one. Also try checking the query that the ID columns is not left out without any values.....
You were right.. Table1 is a master and table2 is a child. So What Should I do to avoid getting the error message?User try to insert Plot number in table2 but that plot number is not exist in the master table (table1)
Its obvious that in a Master - Child table handling, the Master should have the entry inorder to have the refered data in the Child.
1. You cannot avoid this error meaning you should insert the relative entry in Table1 and then insert in Table2
2.If this is not so, then still you need to proceed as such, you need to remove the referential integrity check which is not advisable
3.Your application should be handled in such a way that it requests for the Master entry in Table1 first whenever the entry is not found during insertion in the Table2.
3.Your application should be handled in such a way that it requests for the Master entry in Table1 first whenever the entry is not found during insertion in the Table2
How to check that If the entry is not found in table2...then the message box apear that to ask the user to insert the table1 first. my field name "Plot" is common field. It exist in both table.