3 Replies Latest reply on Jun 15, 2010 10:09 AM by philmodjunk

    displaying records from data in drop down list

    riya

      Title

      displaying records from data in drop down list

      Post

      Hi all,

      I have three table :student, team and semester. student and team have a many-to-many relationship and student and semester have a many-to-one relationship.I want a layout that can display all students in a particular team at a particular semester.

      That is when i choose a semester from a drop down list , i should be able to see all students who are in a given team during that chosen semester.

      Please help me on this one!!


      thanks,
      sunshine3 




        • 1. Re: displaying records from data in drop down list
          philmodjunk

          You need a join table, we'll call it "roster", linking student to team and this join table can include a SemesterID field which can be used to filter the lists for a specific semester..

           

          Student-----<Roster>------Team

                                   

          Student::StudentID = Roster::StudentID

          Team::TeamID = Roster::TeamID

           

          A portal to Roster on your student layout can list all the teams of which that student is a member.

          A portal to Roster on your team layout can list all the students that are a member of that team.

           

          In filemaker 11 you can set up a filter expression on the portal. WIth older versions, you can get the same result by including a filtering pair of fields in the relationships such as:

          Student::StudentID = Roster::StudentID AND

          Student::gSemester = Roster::Semester

           

          Where gSemester is a global field formatted with a value list of possible semesters.

          • 2. Re: displaying records from data in drop down list
            riya

            i have a join table stu_tea( roster for you) and the primary keys  that is:


            Student::StudentPK = Stu_tea::StudentPKTeam::TeamPK = Stu_tea::TeamPK 


            A portal to Roster on your student layout can list all the teams of which that student is a member.

            A portal to Roster on your team layout can list all the students that are a member of that team. 

             

            i have layouts for the above.

             


            What i want is that given a layout like the one in the image:

             

            http://piyaagupte.blogspot.com/2010_06_01_archive.html

             

            where in when i select a semester( i can't make it global , because it has different values) , the students names for that semester appear, according to the teams they belong to.The table that i chose for the layout is the team table for this purpose.

             

            Can you please shed some more light on how to filter pair of fields??

             

            thanks a lot

            sunshine

            • 3. Re: displaying records from data in drop down list
              philmodjunk

              Since you've asked about using fields to filter a relationship, I'm assuming you don't have filemaker 11. (You can do this in filemaker 11 with a lot fewer steps and a less complicated relationship graph.)

               

              Let's start with a global field, gSemester, defined in Team. This is not a field you use to record the semester for any given team or team member, it's a separate field used just for this relationship so that you can specify the semester when looking at a team roster. It doesn't strictly need to be global, though global storage will work better especially if you are sharing this database over the network.

               

              Now for the relationship, I'm leaving out the PK part of the field names for clarity: (PK usually stands for primary key and TeamPK is not a primary key in the stu_tea table.)

               

              Team::Team = stu_tea::Team AND

              Team::gSemester = stu_tea::Semester

               

              (To add a second pair of match fields like this, you can drag from gSemester to Semester or double click the relationship line and add them in the dialog that pops up.)

               

              On your Team layout, place gSemester on it and format it as value list of semester values. When you select different semesters from this field, you'll see the appropriate team roster for the current team record in your portal.