to manage a many to many relation ship between 2 tables I have done this:
I have a tblAllTasks that contains taskID TaskName
the TaskName can be the name of a company, a name of it's customers and the name of the tasks.
the other table is called tablejoin where I have:
joinID, lEntOne_ID, lEntTwo_ID
the customer of one company can also be the customer of another company. Two different customers can have the same tasks.
How would I manage this?
well to add new tasks for a customer I have created a form with two listbox two << >> buttons (add remove in the middle) and a combo box at the top.
in the combobox I select the customer, this will make appear on the right list the tasks linked to him, I select one and remove or select one from the other list and add it with the buttons. Now.. what does two button do? here:
one stored procedure to add the task to the customer
INSERT INTO dbo.tblJoin
(lEntOne_ID, lEntTwo_ID)
VALUES (@myCustID, @myTaskID)
one stored procedure to delete the task from the customer
DELETE FROM dbo.tblJoin
WHERE (lEntOne_ID = @myCompID) AND (lEntTwo_ID = @myTaskID)
after calling one or the other procedure, I refresh the right listbox.
HTH
Alcar