1 Reply Latest reply on Nov 26, 2008 11:26 AM by TSGal

    New to Calculations and Scripts, HELP



      New to Calculations and Scripts, HELP


      I have created to separate tables one called employees and the other Data Entry. In the employees table I have 3 fields: Employee ID, First Name, Last Name. On the Data Entry I have 3 fields: Employee ID, Respondents First Name, Respondents Last Name. I have the two tables related by the Employee ID field.


      What I am trying to accomplish is that when an Employee ID is entered on the Data Entry Table it will look to see if that Employee exist on my Employees Table and automatically fill in the Respondents First Name and Respondents Last Name fields from the First Name Last Name fields on the Employee table. I would also like if the employee ID entered on the Data Entry table did not exist that it would take the new information and store it to the Employees Table.


      I think that I need both tables and I need to write a calculation for this, I tried an IF, but I think I also need a script, but I could be way off. Please Help


      Thank you

        • 1. Re: New to Calculations and Scripts, HELP



          Thank you for your post.


          Return to the Relationships graph in "Manage -> Database".  Between the two tables is a line that has an icon in the middle.  Double-click the icon, and information about the relationship is displayed.  Since you want the ability to add records from either Data Entry or Employees table, check the option on both sides for "Allow creation of records in this table via this relationship".


          Now, when you enter an Employee ID, and the other file doesn't have the data, you can add the information to the other file.  I assume you want this to happen automatically, so you'll have to create a script that either copies the information from one table to the other or switches to the other table and does an import.  The choice is yours.


          If you need clarification for any of the above steps, please let me know.



          FileMaker, Inc.