Jump to content

a drop down menu to go to layout


This topic is 5721 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hello

I have a field "country" and I have three layouts that deal with those countries

the layouts are America, Canada, Mexico

I would like to know how to make a drop down menu that would automatically go to that layout when selected in the dropdown menu.

Thanks

Link to comment
Share on other sites

If[ Table::Country = "America" ]

Go To Layout [Layout pertaining to America]

Else If [ Table::Country = "Canada" ]

Go To Layout [Layout pertaining to Canadia ;)]

Else If [ Table::Country = "Mexico" ]

Go To Layout [Layout pertaining to Mexico]

Else

Show Custom Dialogue [ "Error" ; "You haven't selected a valid country"]

End If

The user must press a button following selection from drop box, filemaker has no inbuilt on event functions so if your desperate you'll have to use a plug-in, if you can though, do without it, its far to much effort.

Also note that my syntax isnt perfect...

~Genx

~Genx

Link to comment
Share on other sites

Well heck, if the layouts are named the country (exactly) then it can be simple:

Go to Layout [ Layout Name by calculation = CountryField ]

... only one script step ...

So you don't even need a drop-down or popup to fire the script or make the selection, because the RECORD tells you the country, right? Just place a generic button, attach this script-step and go.

Update: And by pulling in script parameters (which can identify which layout you are coming from); as well as utilizing the power of script variables, you can really make the process dynamic, ie:

If coming from a layout which starts with the word "List" ; go to the layout named "America List" ; if coming from layout which starts with word "Detail" ; go to the layout named "America Detail" and so forth ...

:wink2:

Edited by Guest
Added Update
Link to comment
Share on other sites

..If Laretta... If...

Read the first sentence, second line of the first post. Even if I hadn't added my update, my response fit the need exactly as requested. But I even went further and explained that the calc I presented was an example ONLY if there was an exact match. The purpose of the example was to provide correct syntax of the CONCEPT.

I take my responses seriously - this is other people's data and businesses we are dealing with and, although we have fun here, it is very important that we provide accurate and tested answers. Oh. And my name is LaRetta not Laretta ...

:smirk:

Link to comment
Share on other sites

Lol, fair enough, point taken, i stand corrected as always.

In this case though, what was wrong with my answer?

~Genx

Edited by Guest
question added
Link to comment
Share on other sites

I didn't say there was anything wrong with your answer. I saw a way of saving him 8 lines of code, eliminating the drop-down, AND the plugin. And I wanted to introduce the calculation concept for further flexibility. :smirk:

The questioning of your syntax was in one of your OWN posts, not mine ... :crazy2:

Link to comment
Share on other sites

This topic is 5721 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.