2 Replies Latest reply on Nov 3, 2010 2:58 PM by GeneGlover

    Change a button's caption based on view

    GeneGlover

      Title

      Change a button's caption based on view

      Post

      Here is my question. I have a layout where I have enabled only table view and form view. I have a button to toggle between the two. I want the button to say "view as form" when in table view, and "view as table" when in form view. I know I can do this with conditional formatting, but what is the condition, i.e. what expression do I have FMP evaluate to know which view it is in. Thanks!

      Gene

        • 1. Re: Change a button's caption based on view
          philmodjunk

          Whenever you need this kind of info, look up get functions in FileMaker help.

          In this case, Get(LayoutViewState) provides the info you need.

          You could use this with two conditional formats for two different blocks of layout text grouped with your button to set the text size of one text block to an extremely large size to make one of the two blocks disappear.

          For the "Table View" block, use Get(LayoutViewState) = 2  to specify a large text size and hide it.

          For the "Form View" block use Get(LayoutViewState) = 0  to specify a large text size and hide it.

          You can also an unstored text calculation field for this:

          If ( Get(LayoutViewState) = 0 ; "Table View" ; "Form View" )

          You can group this field with your button to make it's lable change when the view changes.

          • 2. Re: Change a button's caption based on view
            GeneGlover

            Thank you very much!