1 Reply Latest reply on Mar 7, 2012 9:25 AM by philmodjunk

    Student Database with one table - Can I show a list of specific info on the same layout?

    MichaelHemberger1003

      Title

      Student Database with one table - Can I show a list of specific info on the same layout?

      Post

      I have a single table with student names and apartment numbers. Some apartments have up to 3 students living in it.

      When i pull up a student is there a way to show the other student names who have the same apt number(text field) in some list on the same layout??

        • 1. Re: Student Database with one table - Can I show a list of specific info on the same layout?
          philmodjunk

          Yes if you set up a relationship called a "self join" that matches records on that apartment number field. This will look like you are creating a new table in order to set up the relationship but you are not actually creating a new table:

          In Manage | Database | relationships, make a new table occurrence of Students by clicking it and then clicking the duplicate button (2 green plus signs). You can double click the new occurrence box to get a dialog to appear where you can rename the new occurrence box.

          We have not duplicated a table. Instead, this is a new reference to the same table already present in your database.

          Add it to your relationships like this:

          Students::ApartmentNumber = Students 2::ApartmentNumber

          With that relationship in place you can put a portal to Students 2, but the name field(s) from Students in this portal and you'll have your list of all people living in that same apartment. A more sophisticated relationship can even omit the current student so that you get a list of just the room mates to the current student record.