How to delete record in a Join Table

I would like to find a solution to this problem.

I have a database that has a FORM_A associated with a TABLE_A; this table contains hundreds of records.
This form contains a subform which is a table control containing a list of records which is associated with TABLE_B. There is also a FORM_B associated with this Table_B which also contains hundreds of records. There is a third TABLE_C which makes it possible to establish a relation between these two tables A and B.

This table (Join Table) contains two fields TABLE_A-ID and TABLE_B-ID. So for a specific record in FORM_A (say record 25 of 350), I can see all of the records in TABLE_B associated with it.


    TABLE_C
---------------
 T_A-ID  T_B-ID
   ID1     ID2
   ID1     ID3
 * ID1     ID5 *
----------------

Let’s say that a wrong relation was entered in the case of the line * ID1 / ID5 *; so this should be removed. Obviously the easiest thing to do is to open the TABLE_C, find the row in question and delete it. But, it is a bit laborious. Rather, I’m looking for a way to remove that row from TABLE_C from the FORM_A record, using a query, button, or some other way.

I’ve searched the internet, but I can’t really find any routines that I can use as a starting point. There are many suggestions made considering the UNION, INNER JOIN and a few other commands, but nothing very concrete. Can anyone help me?

In database http://forum.openoffice.org/en/forum/download/file.php?id=11250 there is a many-to-many relation between “Persons” and “Things”. You can open the Persons form and remove any thing related to a person by deleting the coresponding subform record. Likewise you can do the same with a Person entry in the Things form.

2 Likes

Thanks Villeroy, this sample database is exactly what I need. It answered all my questions and more.

2 Likes