2 Replies Latest reply on Apr 13, 2015 11:35 AM by DobhranBlack

    Pulling correct image from related database



      Pulling correct image from related database


      I have two related databases, one with information on each product we have and one with inspection data on individual products. On the first database there is a picture of each product stored in a container field, I want to make it so that on the second database the correct picture is pulled based on some basic info entered into the second databse.

      For example, after entering (in the second database) that the product was from program 3 and variant c, I want to automatically (or through a button) bring over the picture from the matching page (for program 3 variant c) from the first database.

      Is this possible in FMPro 12 and how would it be accomplished?

        • 1. Re: Pulling correct image from related database

          It's possible as this is a basic function of any relational database.

          Ideally, your tables should be linked like this:


          ProductInfo::__pkProductID = Inspectiondata::_fkProductID

          With such a relationship in place the the correct value in _fkProductID, you can add the container field from ProductInfo to your InspectionData layout and it will show the correct image.

          _fkProductInfo can be set up with a value list of product ID's and product names/descriptions to use for selecting the correct Product Info record, or a button on the ProductInfo layout can create a new record in InspectionData with the correct value copied via a variable from ProductInfo to the new InspectionData record.

          Other, more sophisticated ways for selecting the correct ProductInfo record for a given InspectionData record are also possible.

          • 2. Re: Pulling correct image from related database

            I ended up doing it differently by using a portal which only displays values of the field for which the variant types are the samel, it seems to work.