animation_master Posted February 20, 2010 Posted February 20, 2010 How do I show a specific related record, not just the first matching one, in a non-portal field? I have a table Class with the Student_ID as a key. Every Student_ID appears in multiple records (once for history, math, biology, etc.). In a related table Phone, I want to say, "Show me the phone number only for students who are taking history." FileMaker does list only those students, but the field for Class::classname displays "biology" or "math" or "history", depending on which record was created first in the related table. How do I (1) restrict the list only to history students and (2) ensure that the field "classname" displays the class that I entered into the search field?
David McQueen Posted February 21, 2010 Posted February 21, 2010 This sounds like a structural problem. There probably should be four tables: 1. Students 2. Classes (eg: History 2010) 3. Attendees (join of Students and Classes) 4. Phone numbers or communications etc. Each has it's own ID. Attendees has both a Student ID and a Class ID Phone Numbers has a student ID. Given that structure, you should be able to go to the Class table, select a class and see all students in that class, select a student and look through to their phone number. Alternately, you should be able to select a class and pull up a portal of all students with their related first phone number beside them. If the phone number table holds multiple communications methods (also email?) or multiple phone numbers per student (which it should if it is a separate table), you should be able to use a multipredicate relationship to filter what you want to see: ClassID = ClassID And g_ComField set to PhonePrime=PhonePrime As I do not know exactly what is there now, I can only suggest a structure that would work.
LaRetta Posted February 21, 2010 Posted February 21, 2010 [color:blue]How do I * (1) restrict the list only to history students Perform your find in the Class table instead. [color:blue]* (2) ensure that the field "classname" displays the class that I entered into the search field? Your results will always show the proper class because it will be in the Class table. Just place your phone field (from Phones) directly on this Class layout. If you need any Student fields displayed, such as Student name, grade, etc, just place them also directly on your Class layout. If this doesn't give you what you need, please explain a bit more. :wink2:
LaRetta Posted February 21, 2010 Posted February 21, 2010 Very strange ... when I posted against the original question, David's post wasn't there but it looks like it was posted an hour before mine!
animation_master Posted February 24, 2010 Author Posted February 24, 2010 All I did was duplicate the Layout and change it to show records from the Class table instead. Duh! Thank you (and Dave McQueen), very much.
Recommended Posts
This topic is 5455 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now