1 Reply Latest reply on Jul 24, 2012 10:40 AM by philmodjunk

    Help with Pop-up Menu/Layout Functionality



      Help with Pop-up Menu/Layout Functionality


      Hello -

      I am new to Filemaker and have a question regarding Pop-up menus.   I've watched tutoials on lynda.com and searched online for an answer, but I think I'm just missing something basic and am hoping to get some help to get me unstuck.

      I have a layout called Employee View based on the Employees table.

      As you can see from the screen shots, I've added a Pop-up Menu field at the top, but it's not working like I want.

      What I want to happen is to pick from the list of employees and then the Employee Details, Address, Contact change based to correspond to the selected employee in the Pop-up Menu field.

      I've included screen shots of my relationships, Employee View layout and the error message I get when attempting to select a different Employee from the Pop-up Menu.

      Any help would be greatly appreciated.




        • 1. Re: Help with Pop-up Menu/Layout Functionality

          It sould appear that your pop up menu is a format applied to the __employeeIDpk field--something that should never be the case as you don't ever want a user to be able to change this value.

          Since your layout is based on the Employee Table, go to Manage | database | Feilds and create a new field, gSelectedEmployeeID and use field options to make it a field with global storage. You can define this field in any table in the database and it will work as long as you select global storage for it. Often, such global fields are kept in their own table to make them easier to keep track of.

          Put this field on your layout and format it with your pop up menu.

          Then create this script:

          Enter Find Mode [] //clear the pause check box
          Set Field [Employees::__employeeIDpk ; Globals::gSelectedEmployeeID ]
          Perform Find []

          Now select an employee in this new pop up formatted field and then run the script to see if it works as expected. Then you can use the OnObjectModify trigger to perform this script each time you select an employee in the pop up.

          Note: if you based your layout on a different table instead of employees, you could define gSelectedEmployeeID in this different table and create a relationship to employees. Then, you can add fields from employees to this layout and selecting an employee will bring up the data on that employee without needing a script.