« Return to Thread: stand alone deployment

Popup menu values from linked table

by Stephane Potvin-2 :: Rate this Message:

Reply to Author | View in Thread

Good day all,

I am a musician and want to catalogue my music scores.

I have a database that uses a table for composers and one table for  
the music scores.
The tables are linked.

The current way of doing things is:

I create an entry for a composer.
Once in the composer record, I add a record in the music score table  
(which acts as a sub table)

I like this approach because that way I can see every score for one  
composer in one window.

The one downside is that everytime I want to create a score I have to  
go through the composer table.

I have tried creating a popup menu in the score form using the values  
from the composer table. It only kind of works. Although the value is  
indeed entered the field composer, the name of the composer does not  
show, of if I go back to the composer table, I end up with a form  
that appears empty.

In any case, my question is: can one use values from a linked table  
to populate a popup menu and have it work properly?

Here is the code I currently use.


Case of
        : (Before)
                ALL RECORDS([Composer])
                SELECTION TO ARRAY([Composer]name;pu_compo;[Composer]Number;pu_number)
                If ([Score]Composer=0)
                        pu_compo:=0
                Else
                        pu_compo:=Find in array(pu_number;[Score]Composer)
                End if
        : (During)
                [Score]Composer:=pu_number{pu_compo}
End case

Help would be greatly appreciated.

Stephane

**********************************************************************
4D Basics hosted by 4D, Inc.                       http://www.4D.com/

An all-new List box. More features, more power.
Headers, footers, cell formatting and other goodies.
See it here first! <http://www.4d.com/livedemos>

To Unsubscribe:                        mailto:4DBasics-off@...
**********************************************************************


 « Return to Thread: stand alone deployment