Simon-UK Posted February 18, 2006 Posted February 18, 2006 I have two tables linked. The parent is “Hotel” and the child is “contacts”. I am trying to create a calculated field in the parent that searches through the related records in the portal. I’ve set up the calculation however it only returns the answer for the first record and doesn’t appear to search all the related records and select the related record that returns the correct answer. I am doing this so that when I write a letter from the child I can take this information from the parent and hence have a link across related child records. The calculation that I'm using is: Champion = If (Contacts::Attended Workshop 2006 = "Yes"; Contacts::FirstName & " " & Contacts::LastName) This calculation works but only for the first record. Do I do this through a calculation? Thanks for your help Simon
IdealData Posted February 18, 2006 Posted February 18, 2006 The calculation can only ever evaluate the first matching related table entry. Are you sure you understand the relationships? You appear to be trying to find the "parent of a child" whereas I think you need to finding "all children of the parent". Remember, a child can only have one mother, however a mother could have many children.
Genx Posted February 19, 2006 Posted February 19, 2006 .... hey, dont be so ignorant, what about homosexual parents? its a modern world, a child could have two mothers, or two fathers ... but really simon, what you want may be achievable depending on how many criteria your calculation needs in order to evaluate to true... for example... you could add another table occurance and specify a relationship between the parent and child TO's that would return only one child to the parent... alternativly you could perform a sort... this is all because you will only ever be able to pull information from the first related record through a standard calculation in anything below fm 8. ~genx
IdealData Posted February 19, 2006 Posted February 19, 2006 Not on a truly heterosexual basis! Your comments are not helping a proclaimed "intermediate" FMP user. With so much understanding of relationships, would you like to update your proclaimed "beginner" status? I was moderating the relationships section some time ago. Read between the lines - not all the users express their comments in the best way.
LaRetta Posted February 19, 2006 Posted February 19, 2006 :exactly: I'm confused on what the PURPOSE is. Well, if the tables are related just cross-place the fields (put fields directly from the related table) whereever you want and perform a Find[]. From child table place field from parent. Search for Parent name. You will find all children. From parent table place field from child. Search for child name. You will find all parents. ROFLMAO!! Or use GTRR... LaRetta
Fenton Posted February 19, 2006 Posted February 19, 2006 What we have here is a mish-mash. There are several FileMaker terms somewhat mixed up in the original question. I don't think there's a need for either a search or calculation. If you want to see the "parent" info in the "child" table, for a letter, it should be available as related fields, via the relationship (that makes them a child). Nothing else is needed. (We're talking "generic parent" here, nothing to do with 2 people and their children per se.) Now, Hotel may be the parent, and Contacts (at the Hotel) may be the child. But "Attended Workshop 2006" really should not be a field in Contacts. There should be a separate table for these "events". If there is only 1 event concerned, and it only happens once a year, it could be as simple as the ContactID and the year. You should not have fields that specify the year. It creates a problem next year, not too mention in layouts and reporting. It is completely unnecessary with good relational design (you may detect a nuance of annoyance; because I've had to "normalize" this kind of stuff too many times.) And in that case both the Hotel info and the Contact info would be available from "Events," as related fields. That's what relational databases are all about.
Simon-UK Posted February 20, 2006 Author Posted February 20, 2006 Thanks for your responses and lessons in parenting. The purpose was to use information across the children... The “event” route will be fine, I just wonder if there was another way.
Genx Posted February 21, 2006 Posted February 21, 2006 .. why does everybody take everything i say so seriously... i mean really, im 16 ~genx
Recommended Posts
This topic is 6850 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