1 Reply Latest reply on Aug 13, 2015 7:04 AM by philmodjunk

    Relationship not working...   why?

    RaphaelVang

      Title

      Relationship not working...   why?

      Post

      Hi,

        -  it's quite frustrating, as a longtime FM-user, when you stumble upon a problem that shouldn't be one...  ^^

      But, as usual, I just post a quick question here, instead of ripping all of my hair out...

        Hope it's easy;

       

      Table 1

         ID

         LINK

         Field 1

         Field 2 Picture

      Has 50 records  (ID 1-50)

       

       

      Table 2

         LINK

         Field 10 (Text, Value list )

         Field 11 Picture (container; calculation)

         Field 12  (Text, Value list)

         Field 13 Pircture (container; calculation)

         

       

      In Table 2, I want to be able to see the picture from Table 1 - by selecting the Fields 10, or 11.

        So; Field 10 selects the value for 11, and 12 for 13.

       

      I have created a relationship by using the “LINK” fields.

        But nothing happens when I try the formula;

       

      Case (

      Field 10 = “number 10” ; GetNthRecord (Table 1::Field 2 Picture ; 10);

      Field 10 = “Number 4” ; GetNthRecord (Table 1::Field 2 Picture ; 4) )

       

       

      What am I doing wrong???

       

      I think that I don’t understand the “relationship idea properly…

      Since Table 2 doesn’t have 50 records, but just 1 record, I don’t want to use the ID = ID relationship.

        I just want to “grab” information from another Table, by telling FMP10;

        “this is the value; so grab that picture…”

      But it doesn’t

        Ah, and I want to do this two times on one layout…   but; that shouldn’t make any difference, I think.

       

      Cheers

      R

        • 1. Re: Relationship not working...   why?
          philmodjunk

          Yes, it would appear that you don't have the relationship set up properly. But you don't tell us how you set it up either.

          It would seem that you need these relationships:

          Table 1----<Table 2>-----Table 1 2

          Table 1::ID = Table 2::Field 10
          Table 1 2::ID = Table 2::Field 12

          That will work if you are just dealing with two Images in each table 2 record. But in other relationships may make more sense both here and especially if there are more than two images that you want to link to a given record in Table 2.

          You might use this relationship:

          Table 2::__pkTable 2ID = Table 1::_fkTable2ID

          To link one Table 2 record to many Table 1 images.

          Then you could place a series of one row portals on your Table 2 layout and give each a portal filter that each uses the value of a different field such as your fields 10 and 12 to filter for a specific image out of the related set.

          And in other cases, if the same image may need to be linked to more than one record in table 2 you may need a join table between table 1 and 2 in your relationship.