hartmut Posted April 1, 2006 Posted April 1, 2006 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
Genx Posted April 2, 2006 Posted April 2, 2006 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
LaRetta Posted April 2, 2006 Posted April 2, 2006 (edited) 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 April 2, 2006 by Guest Added Update
LaRetta Posted April 2, 2006 Posted April 2, 2006 ..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:
Genx Posted April 2, 2006 Posted April 2, 2006 (edited) Lol, fair enough, point taken, i stand corrected as always. In this case though, what was wrong with my answer? ~Genx Edited April 2, 2006 by Guest question added
LaRetta Posted April 2, 2006 Posted April 2, 2006 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. The questioning of your syntax was in one of your OWN posts, not mine ... :crazy2:
Genx Posted April 2, 2006 Posted April 2, 2006 Rightio, good thinking, sorry i'm a bit of an A**hole sometimes, i should really stop doing that. Oh well, my appologies ~Genx
Kasei Posted April 3, 2006 Posted April 3, 2006 LaRetta and Genex, Thanks for this post. It gave me a new direction with a problem I have been having with a system I am currently building. Thanks again guys. Kasei
Recommended Posts
This topic is 6871 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 accountSign in
Already have an account? Sign in here.
Sign In Now