I have a table that contains departments. This table is used to populate a dropdown menu for a detail record. I would like for the dropdown menu to only populate with departments that are not already assigned to the master record.
Department Table
Dept1
Dept2
Dept3
Dept4
Dept5
Detail Table
masterID id department
1 1 Dept1
1 2 Dept2
1 3 Dept5
2 4 Dept5
3 5 Dept2
3 6 Dept1
Given the above the user would have the following departments list in dropdown when editing detail record for corresponding master record.
masterID 1
Dept3
Dept4
masterID 2
Dept1
Dept2
Dept3
Dept5
masterID 3
Dept3
Dept4
Dept5
Thanks in advance for any assistance!