5 Replies Latest reply on Apr 19, 2009 2:49 AM by Bauke

    Exploring FMP; Some questions

    Bauke

      Title

      Exploring FMP; Some questions

      Post

      Hello,

       

      I have an input form wich should update (insert) 2 records in the same table. The first four fields are the same for both records, the following fields are not. 

      Browsing through the records goes fine except that I get the same records twice where the 'following fields' are switched. With a 'distinct' that would be over. How do I limit the records in my layout with 'distinct ( w_wnr)?

       

      And how do I save the inputform to two records. The first four filed I mean, should go into two records.

       

      Some screenshots (relation and inputform)

       

       

       

      Thanks in advance!

       

      Bauke

       

      PS. I'm migrating from MySQL to FMP. In MySQL I had in a table wedstrijden one records for every wedstrijd. And a view that made a table where very wedstrijd had two records (one for every player). In FMP I'm trying to get both working. So I have two .fp7 files with different wedstrijden tables. I have asked some question before on this forum and some people might think I'm trying to confuse them. I'm not! It just are two solutions I'm trying out.  

       

        • 1. Re: Exploring FMP; Some questions
          TSGal

          Bauke:

           

          I'm having a little trouble understanding what you are trying to accomplish, even with the screen shots.

           

          If the first four fields are the same, why do you have five fields linked to the second table occurrence?

           

          Is the information being added via a portal?  If so, is the option to add records via the relationship turned on?

           

          What prompts the second record into the same table?  Is it done via an import?

           

          Any additional information would be helpful.

           

          TSGal

          FileMaker, Inc. 

          • 2. Re: Exploring FMP; Some questions
            Bauke
              

            Hello,

             

            Sorry, I meant five fields (the fields above the names in blue; see screenshot above)

            It's not via a portal. The user (me) is just filling fields in the inputform. The first five are the same.  These 5 fields + the fields below the left blue name should make the first record. The 5 fields  + the fields below the right blue name should make the second record.

             

            Don't know if this is possible. With a script and variables maybe? I have no experience with scripts yet. Still learning.

             

            Hope this helps

             

            Bauke

            • 3. Re: Exploring FMP; Some questions
              FentonJones
                

              FileMaker basic (tables, fields) structure is not really different from any other relational database. So if you had a good existing structure of 2 tables, you would likely have 2 tables in FileMaker. As TSGal pointed out, in her questions, the most likely entry of the 2nd record (in this case) would be into a portal; which is a mechanism to both view, and create/edit data in a related table.

               

              It is like a little window into the other table. A relationship (table occurrence on the Relationship Graph)* ties them together in a specific way; commonly using the primary ID of the "parent" table to its equivalent foreign key in the "child" table, but it could be any other logical relationship. That is where the fields that are different would go. 

               

              If you have the [x] Allow creation of related records turned on then entering data into the first empty portal row (it will be made available by that option) will create the related record, and populate the foreign key, tying them together (you not need to and should not manually enter data into the foreign key). Generally the rows are 1 line tall, but they can be most any height, with the fields arranged however you want.

               

              If you want a better way of printing the data, then a FileMaker report, from the child table offers more possibilities, such as Subsummaries (so that the parent data only appears once, with its child records below (and/or above) it. 

               

              *This is where FileMaker structure differs from other relational databases (which I know little about). A FileMaker Relationship Graph can have many instances (table occurrences) on the graph from the same "base table." You could think of it as a more formal visual method for "views", though I imagine there are (many) differences from SQL on that.

              • 4. Re: Exploring FMP; Some questions
                obeechi
                  

                Would this work with three tables? Where the first table is for the first five fields that are the same, and the remaining fields for two different records could be in two related tables (related to the first that is)?

                 

                I know you don't want null fields. Like if you have one table split into two tables, to avoid nulls, I get confused how you create a one to one relationship. In this case, is there a possibility of using a one to one relationship?  

                • 5. Re: Exploring FMP; Some questions
                  Bauke
                    

                  Fenton, Obeechi,

                   

                  Thanks for your thoughts. I will try.....

                   

                  Bauke