4 Replies Latest reply on Mar 17, 2015 9:31 AM by amandahbell

    Get Active Tab--I'm at a loss.



      Get Active Tab--I'm at a loss.


      Product: Filemaker Pro Advanced 13

      System: Windows 7

      I have 11 tabs named T1...T11. I also have a field called "TransectNumber".

      I would like that field to be an autocalulation of the number following the T on the tab.

      I have tried:

      Case (
       GetLayoutObjectAttribute ( "T1" ; "isFrontTabPanel" ) ; "1" ;
       GetLayoutObjectAttribute ( "T2" ; "isFrontTabPanel" ) ; "2" ;
       GetLayoutObjectAttribute ( "T3" ; "isFrontTabPanel" ) ; "3" ;
       GetLayoutObjectAttribute ( "T4" ; "isFrontTabPanel" ) ; "4" ;
       GetLayoutObjectAttribute ( "T5" ; "isFrontTabPanel" ) ; "5" ;
       GetLayoutObjectAttribute ( "T6" ; "isFrontTabPanel" ) ; "6" ;
       GetLayoutObjectAttribute ( "T7" ; "isFrontTabPanel" ) ; "7" ;
       GetLayoutObjectAttribute ( "T8" ; "isFrontTabPanel" ) ; "8" ;
       GetLayoutObjectAttribute ( "T9" ; "isFrontTabPanel" ) ; "9" ;
       GetLayoutObjectAttribute ( "T10" ; "isFrontTabPanel" ) ; "10" ;
       GetLayoutObjectAttribute ( "T11" ; "isFrontTabPanel" ) ; "11" ;

      Which returned nothing.



      Get ( TriggerTargetPanel )

      Which returned 0 when output as a number and nothing as text.

      I've only been working with FileMaker for a month so if I'm doing this completely wrong please tell me. Like if I should have a OnPanelSwitch script trigger on the tabs. I'm completely lost.

        • 1. Re: Get Active Tab--I'm at a loss.

          GetLayoutObjectAttribute refers to a layout object by its object name. This is not a panel label of a tab control. The first thing that you would need to do is use the Inspector's Name box to give each tab panel a different object name--which could be the same text as the tab label. The next thing that you'd need to do is make this calculation field unstored as changing tab panels will not cause this calculation field to update.

          A better approach might be to use a script trigger on the Tab control such as OnPanelSwitch (It has a different name in FileMaker 12 and is not found in older versions) to perform a script. That script can use get ( TriggerTargetPanel ) in a set field or set variable step to update either a field or variable to show the object name of the front tab panel.

          • 2. Re: Get Active Tab--I'm at a loss.

            Forgive my incompetence, but I want to make sure I do this correct.

            I made the field TransectNumber text so it'll accept anything.

            Set a Script Trigger "OnPannelSwitch"

            Script Called "Set Transect Number"

            Script contains "Set Field" script which specifies target field as "TransectNumber" and Calculated result as "GetValue(Get(TriggerTargetPanel);1)".


            But still nothing.




            • 3. Re: Get Active Tab--I'm at a loss.

              Did you use the inspector to name each panel of your tab control with an object name?

              • 4. Re: Get Active Tab--I'm at a loss.

                Nope.  You nailed it! I had a space in my Transect Number.

                THANK YOU!