Bill Jaynes Posted March 23, 2001 Posted March 23, 2001 Hello, I have a db Personnel that has straightforward contact info. Another db Contracts has fields for, say, Manager, Foreman, Straw Boss and Paymaster. What I would like to do is create some relationships so that when the user enters a Foreman's name in Contracts, if it matches a name in personnel, related fields display the appropriate contact info. At this point, entries in Personnel are "equal" in that they are not flagged with roles Manager, Foreman etc. The reason for this is that the individuals could be Manager on one contract and Paymaster on another. I have lots of other relationships not needing any couples therapy but this one has me stumped for a design. Thanks to whosoever tackles this. Bill
LiveOak Posted March 23, 2001 Posted March 23, 2001 In your Personnel file, have a field "Personnel ID", an auto-entered, unique servial number. In Contacts, have fields for Forman ID, Manager ID, Straw Boss ID, and Paymaster ID. Fill these in with the ID's of the appropriate personnel (could be a pulldown with both ID and name from the Personnel file). Build a separate relationship for each of these categories (foreman, manager, etc.) matching (for example) Foreman ID <--> Personnel ID. Use these relationships to display information from the Personnel file in the Contacts file. -bd
Bill Jaynes Posted March 23, 2001 Author Posted March 23, 2001 Thanks for your response. What you say is very useful. My quandry is how to have the related personnel fields show just the information for that relationship. I got something going but if one relationship had a good match, every : :personnel_phone field on the page showed the same phone number. So How can I have a matching Foreman: :personnel show only the matching : :phone while on the same page have a matching Manager field force another : :personnel_phone field show the correct phone for THAT relationship. I tried forcing this by having the related fields appear in portals but they still shared the same phone number even though it was valid for only the Manager. Thanks for your patience, Bill [ March 23, 2001: Message edited by: LiveOak ]
LiveOak Posted March 24, 2001 Posted March 24, 2001 You're doing something wrong. If you have separate relationships from Contracts to Personnel for: 1) Foreman, call it ForeRel, ForemanID <--> PersonnelID 2) Manager, call it ManRel, ManagerID <--> PersonnelID 3) Straw Boss, call it Straw Rel, StrawBossID <--> PersonnelID 4) Paymaster, call it PayRel, PaymasterID <--> PersonnelID For the Foreman's information in Contracts: enter ForemanID and display ForeRel::Name ForeRel::Phone For the Manager's information in Contracts: enter ManagerID and display ManRel::Name ManREl::Phone etc. If this doesn't clear up the confusion, I'll create two example files and send them to you. -bd
Bill Jaynes Posted March 24, 2001 Author Posted March 24, 2001 Thanks so much! I just got it! I wasn't checking the related fields relationships. Bill
Bill Jaynes Posted March 26, 2001 Author Posted March 26, 2001 I set up fields and relationships as per our discussion and the relationships work except for the creation of related records. I have the option to do so checked where needed and all fields are of the type text. My master file key is "Managerfirstpluslast", which concats the managers' first and last names. In the related file(personnel) the key is "personnelfirstpluslast" which concats personnel's first and last names.I have other files related where merely typing the letter A in a ::related field creates a new related record. I am getting the dialog warning for manager/personnel stating the relationship is not valid when I try to enter a : hone number in the master file. When I enter a first and last name for manager, that doesn't start a related record; though they remain as entered but do not appear in a new related record.
Recommended Posts
This topic is 8711 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