Re: how to implement Many-to-Many relationship in Forms 4.5?

From: Cor van Donge <donge_at_ibm.net>
Date: 24 Jun 1998 21:04:00 GMT
Message-ID: <01bd9fb2$72e75440$d9432581_at_donge>


A view is not the solution. It will show too many records on both sides of the intersection.

I you have for instance a many to many relation between persons and addresses
then you need an intersection table.
To maintain this you can make two screens with a Master - Detail relation. Persons --= intersection and
Addresses --= intersection

Another way to go is to make one screen

Persons --= intersection =-- Addresses

and make no links between them. With triggers you can change the default where part of a block. If you do f.i. a next record in Persons you change the default where part for the intersection and do an exe query so that it retrieves all the records with that prs_id. Then you go to the Addresses block and set the default where clause to the Adr_id of the intersection table. Do an exe query and voila. It is a lof of coding, but it works.

Phil Lee <wt786_at_vtn1.victoria.tc.ca> wrote in article <358d7d72.0_at_news.victoria.tc.ca>...
> Hi,
>
> Does anyone know how to implement a Many-to-Many relationship in
> Forms 4.5 or Forms 5.0?
>
> Here are the tables for the Many-to-Many relationship:
>
> PEOPLE
> ______
> # person_id
> first_name
> last_name
> title
> organization
> addr
> city
>
> EXHIBITORS
> ----------
> # exhibitor_id
> exhibitor_name
> description
> exhibitor_type
> comments
>
> PEOPLE_EXHIBITORS
> -----------------
> #person_id
> #exhibitor_id
>
>
> The persion_id and exhibitor_id are sequence numbers and they are not
> visible at runtime.
>
> The PEOPLE_EXHIBITORS table is the intersection table and is not
> visibile at runtime.
>
> I want to create a form that display both tables PEOPLE and EXHIBITORS.
> When I do query in the PEOPLE block, I want retrieve all the EXHIBITORS
> associated with a record in the PEOPLE block, and when I query in
> the EXHIBITORS block, I want to retrieve all the PEOPLE records
associated
> with a record in the EXHIBITORS block.
>
> Any help will be deeply appreciated.
>
> TIA.
>
> --
>
>
> --
>
Received on Wed Jun 24 1998 - 23:04:00 CEST

Original text of this message