Title

help with scripts in FM 11

Post

I have a database (FM 11) that i would like to have zip codes in one column associated with a "region" in another. I would like this to be automated where as i enter the zip code in column one and column 2 would set itself automatically to the predefined region. Simply put if i enter a zip code from the Los Angeles area in the zip column i would like the geography column to automatically have "L.A. Area" entered into it. Subsequently if i enter a zip from brooklyn into the zip column i would like the geo column to have brooklyn automatically entered.

I have limited experience with scripting and think i should use the "IF" script but i do not know how to set the automatic setting of the second column. Can anyone here help me out with this?

What you need is a relationship that matches the zip code field of your current layout's table to the zip code field of a table of zip codes and geographic areas. Do you have such a table? Do you have such a relationship?

Once you have the relationship, you can add the geographic area field from this related table and when you enter or select a zipcode in the layout's zip code field, the geographic area field from the related table will automatically display the corresponding area name.

I do have a table with the zips/area names. I hadn't thought of useing a relationship though because one "geolocation" has 45 different zip codes and I just wasn't sure how to do that. Not only that but I will also need to have 30ish of these separate geo associations using the same 2 fields. Sorry if this doesn't make sense, I am new to filemaker and am just trying to figure this out. Thank you for your response.

And that post supplies the missing info. There is more than one way to use a relationship link. If you are using an auto-enter field option such as a looked up value or auto-entered calculation, pre-existing records won't automatically update. Re-lookup works for looked up value field options. Replace Field Contents can update auto-entered calc fields.

But you can also use other methods that dynamically link to the data instead of copying it from the look up table. Which is best depends on the way you need to work with this data.