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.
Thanks for the quick reply. I will give it a try!
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?
FMpro 11 on Windows XP
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.