Avoid Duplication in Master Table
420648Jun 4 2007 — edited Jun 10 2007Hi,
With regards to form’s master detail relation ship application I created two tables that are “department” as master table and “employee” as a detail and deptno is the field which may establish relationship b/w these two tables on forms.
There are three fields on “department” block (deptno (pk), dname, location)
And four fileds on “employee” block (empno, ename, deptno (fk), salary).
I am using sequence to generate deptno in “department” table.
Suppose there is one record in the “department” table that is
(1, Finance, Malta) and one record in “employee” table that is
(001, Mark, 1, 4000).
Now I wanted to insert another record in the “employee” table through the form application, that is (002, Robert, 1, 5000), which belongs to the same single record in the “department” table.
So on run time form query the record from “department” table that has only one record and then I enter the new second record in “employee” table then click save,
I am wondered to see that form also save the same record in the “department” table that is (2, Finance, Malta), along the new second record in “employee” table.
That’s duplicate the record in “department” table.
How should we avoid this duplication so only the new record inserted into the “employee” table against the single record in “department” table?
Examples will be highly appreciated.
Thanks
Benazir