Sign in to follow this  
Followers 0
animation_master

Show NOT First Related Record

5 posts in this topic

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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

[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:

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0