dovcamp Posted July 26, 2001 Posted July 26, 2001 I have a single DB for student records. When you bring up a specific student there is a portal that shows who that students siblings are. To accomplish this I created a field called ID1 which is defined as: Student Last Name & Right(Primary Home Phone,4) so that any students that share a common last name and the last 4 digits of their phone number are considered siblings. Then I created a self relationship where ID1:ID1 and I place this in a portal. It brings up the siblings but it also lists the current record. So that the current student shows up as his/her own sibling. Is there a way to elimanate the current record from the list?
Kurt Knippel Posted July 26, 2001 Posted July 26, 2001 During your navigation, set a global field to StudentID (or whatever the primary key of your record is), then create a calculation field (cFamilyID) with the following: If ( StudentID <> gStudentID, FamilyID, "" ). You relationship then becomes FamilyID::cFamilyID, and you will show all related records apart from the current record. Of course you have a serious problem with relating records via such a volitile data as the last name and phone numbers. As soon as one of those changes your relations all break. I highly recommend that you use genuine IDs. See my FAQ for how to accomplish this http://www.fmforums.com/ubb/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=8&t=000018
dovcamp Posted July 26, 2001 Author Posted July 26, 2001 When I set up the field cFamilyID like: If ( StudentID <> gStudentID, FamilyID, "" ) for some reason the result comes out to just the last 4 digits of the students phone number which is different then the FamilyID which is lastname + last 4 digits of phone number. Any ideas?
markpro Posted July 27, 2001 Posted July 27, 2001 When I create fixed length portals, I use a second relationship to find the related records and reindex the "show" group all controlled by scripts.
LiveOak Posted July 27, 2001 Posted July 27, 2001 Make sure the field definition for cFamilyID has the type for the result set to text, not number. If the resulting type is number, all characters except numbers are ignored. -bd
dovcamp Posted July 27, 2001 Author Posted July 27, 2001 Ok, that fixed that. However when I create the relationship: FamilyID::cFamilyID I get the error "This relationship will not work because the field ::cFamilyID cannot be indexed." Any ideas? Thanks
markpro Posted July 28, 2001 Posted July 28, 2001 It's been a long day...I am starting to brain fluf. I'll try to expand sometime this weekend. Sorry for the delay.
Recommended Posts
This topic is 8521 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