5 Replies Latest reply on Mar 13, 2010 5:14 AM by Pebbles

    ONE TO MANY RELATIONSHIP

    Pebbles

      Title

      ONE TO MANY RELATIONSHIP

      Post

      Hello, I am in need of some help.  I am working with FM 10 on Windows and I have created a one to many database to store Parent and child information. 

      I have two tables one for parent and one for child. each have their own id number. I created a portal on the parent table to enter the child information. but at first it was not creating a child id on the child table. I have fixed that, but now when I enter the child info on the parent table it does not show in the portal.

       

      is there a way I can fix that? Please keep in mind I am new to FM 10 and so I am learning as I go along.

       

      any help would be appreciated.

      Thank you 

        • 1. Re: ONE TO MANY RELATIONSHIP
          spectre6001

          In the relationship diagram section of the database manager, you need to double-click on the "=" in the relationship box, and be sure that you can create records in the child table via that relationship. The checked box should be on the child side.

           

          The child ID field should be set to auto-fill with a serial number (accessible from the database manager field section, set the field to text, click options, check the auto-fill serial number radio button and set it to start at whatever number you wish).

           

          The portal in the parent table should be set up based on the child table with records from the child table. 

           

          In the portal, add the child fields you want, and that should do it.

           

          Note, the fields must be located neatly within the first line of the portal. If they overhang the edge, the field will not show up in the portal or display the correct information.

           

          Hopefully that helps. Good luck!

          • 2. Re: ONE TO MANY RELATIONSHIP
            Pebbles

            Thank you Spectre6001.  I checked my relationship and options on the portal and I have it set up just the way you described. I have everything I need as far as information.  the only thing is that when I enter the child data in the parent screen portal and hit enter the portal does not show the child data but I when I check the child data it is in there.  but I would also like to see it on the portal.  Is that possible?

             

            the portal was showing the info before but I don't know what happened that now it does not show. I thought maybe it might be the way I have my relationship set up:

             

            parent table child table

            id --------=------------ id

            name name

            address grade

             

             

            then I have a TO labeled child data 2 that is also related to the parent table


             

             

            • 3. Re: ONE TO MANY RELATIONSHIP
              RickWhitelaw

              "The child ID field should be set to auto-fill with a serial number (accessible from the database manager field section, set the field to text, click options, check the auto-fill serial number radio button and set it to start at whatever number you wish)."

               

              This is incorrect.

               

              The PARENT ID FIELD should be set to auto-enter serial number. That ID should be a match field to the CHILD TABLE ID FIELD. When you create "child" records the the ID from the parent table is automatically set in the child table's new record.

              • 4. Re: ONE TO MANY RELATIONSHIP
                comment_1

                To clarify further:

                 

                In the Parent table, the ParentID field should auto-enter a serial number.

                 

                In the Child table, the ParentID field should have no auto-enter options - and this would be the matchfield to the Parent table. The ChildID field should auto-enter a serial number - but this field would not be used for the relationship.

                • 5. Re: ONE TO MANY RELATIONSHIP
                  Pebbles

                  Thank you!!!! It worked.  :womanvery-happy: problem solved

                   

                  It was how I had set up my relationship. Once I changed it, It gave me exactly what I wanted.

                   

                  Kudos to you!!!!