Re: HELP: how to implement M:N in Forms 4.5

From: Todd Owers <ToddO_at_gcr1.com>
Date: 1998/03/04
Message-ID: <01bd479e$c2e47980$764c1bcc_at_toddo.gcr1.com>#1/1


Patrick,

You can use a Post-Query trigger on the detail block to display the developer name. Establish a control item (Base Table = False) in the detail block to hold the name. Then, put this code in the Post-Query trigger (assuming the control item is :prog_dev.dev_name):

SELECT developer.dev_name
INTO :prog_dev.dev_name
FROM developer
WHERE developer.dev_ssn = :prog_dev.dev_ssn;

The Post-Query trigger fires once for each record in the block, so if you have multiple developers for a program, :prog_dev.dev_name will be populated for each developer.

Hope this helps.

Todd Owers

Patrick Demets <demetsps_at_cadvision.com> wrote in article <34FCF4F5.4ADF_at_cadvision.com>...
> I'm sure this question has been asked before, but just the same:
>
> How can I implement a many-to-many relationship in Dev2K Forms?
>
> Let's assume I have three tables:
> PROGRAM (*prog_id, prog name, ...)
> DEVELOPER (*dev_ssn, dev_name, ...)
> PROG_DEV (*prog_id, *dev_ssn)
>
> where a program can be developed by one or more developers, and a
> developer can develop zero or more programs.
>
> In my form, I have a master block (PROG_BLK, base table PROGRAM) and a
> detail block, where I want to display the name of all developers related
> to the program in the master block. I can display the dev_ssn of all
> developers in the detail block (from PROG_DEV), but I can't get the
> dev_name from DEVELOPER.
>
> Many-to-many relationships are common in modelling. There must be a way
> to easily implement this in Forms. Any help would be appreciated.
> Reply to my email or post to the group.
>
> Thanks,
> Patrick Demets
>
Received on Wed Mar 04 1998 - 00:00:00 CET

Original text of this message