1 Reply Latest reply on Sep 13, 2013 8:54 AM by philmodjunk

    Auto fill



      Auto fill


           Hello all,

           I am creating a table which will contain the following information:

           Unique ID
           Staff ID
           Staff Name
           Year Level

           I have created a layout in list view which I want to display the Staff ID, Staff Name and Year Level. The information for the year level is coming from a value list. The information for the Staff Name displays a value list which comes from the Staff table.

           My question is, how do I get the Staff ID field to be automatically filled in when they select the Staff Name. The Staff ID field is simply another value which is in the Staff Table and is associated with each staff member name. 





        • 1. Re: Auto fill

               The simple (not always best) solution:

               Format Staff ID as a drop down list or pop up menu. For the value list, specify the Staff ID from your other table for field 1. Specify the staff name for field 2. When you select from this value list, you can select by name, but the value list will enter the staff ID. You can remove the Staff name field from your table and replace it with the staff name field from your related table. (same table as that specified for your value list.) This assumes that you have set up a relationship between the two tables that match records by Staff ID.

               A more complex solution: (Requires scripts)

               Your Staff name field can be used with a script to look up a record or records from your other table and enter the Staff ID from that table into the staff table. This method allows your value list to be an auto-complete drop down list and also can handle situations where you have two or more persons with exactly the same name. But it requires a more complex set of relationships and some scripting to make it happen. Here's a demo file:

               FileMaker 12 users: https://dl.dropbox.com/u/78737945/SimpleNameLookupDemo.fmp12
               Pre FileMaker 12 Users: https://dl.dropbox.com/u/78737945/SimpleNameLookupDemo.fp7