4 Replies Latest reply on Jul 2, 2010 11:59 AM by philmodjunk

    Go back to last layout


      Go back to last layout


      I have recently taken over a FMP database (8.0) I would like to put in a navigation button to take the person back to the last layout/screen they were at. Say they are on one layout that has a button to jump to another layout and when it pops up on the screen they realize they didn't actually want to go there. How can I get them back to the last layout? I don't want to use GoToLayout with a specific layout name as this can vary. Thanks in advance for any help you can give me!

        • 1. Re: Go back to last layout

          Define either a global text or global number field.

          Script each navigation button to include either


          Set FIeld [Yourtable::globaltext ; get ( layoutname) ]




          Set Field [yourtable::globalnumber ; get ( layoutnumber ) ]


          before actually switching to the desired layout.


          Now write a script


          go to Layout


          and select either the layout number by calculation or layout name by calculation option.


          Perform this script from a button to take the user back to the previous layout. If you use a global text field, you can even create a button that displays the name of the previous layout for this.

          • 2. Re: Go back to last layout
               Thanks for the quick reply. I will give it a try!
            • 3. Re: Go back to last layout


              your suggestion has been very helpfull for me.

              But now I have a bigger problem: my database has a lot of layouts and a lot of navigation buttons.

              Is there a way which will not required to be done for every single navigation button?

              Many thanks

              FMpro 11 on Windows XP


              • 4. Re: Go back to last layout

                Once you've set up a button to switch to a given layout, you can copy and paste it to other layouts where you need the same button.

                You can also pass the desired layout name (or number) as a parameter and have just one script for all your layout changes.

                Set Field [YourTable::gLastLayout ; Get ( LayoutName ) ]

                Go To Layout [ Get ( ScriptParameter ) ] //Use the by calculation option when specifying the layout.