Dezza12 Posted March 26, 2002 Posted March 26, 2002 I am trying to write a script that will automatically enter the county name in the "County" Field, when I enter a zip code in the "zip code" field. There are about 460 or so zip codes, and 32 counties. I have tried to use Case, but after I get past a certain number (not exactly sure how many), I get an error that says "There are too many separators in this function", Any suggestions? Thank you!
Fitch Posted March 26, 2002 Posted March 26, 2002 "...too many separators..." simply means you have an extra comma somewhere in your calculation. But why make it so hard on yourself? Just make a Counties file with 2 fields, zip and county, and use this file for a lookup from your main database. You wouldn't even need a script!
Dezza12 Posted March 26, 2002 Author Posted March 26, 2002 Hmm, the new file idea seems perfect, and I will probably try that, and I agree with what you say the "too many separators" error is telling me, but I only get the error after I continue to add portions to the case function, and then, the error always highlights back toward the beginning of the script where I have already test saved the calculation, and it highlights a part of the calculation where no error is visible. So I think in this case it has to do with too many entries in the case function, but I'm not sure.
Fitch Posted March 26, 2002 Posted March 26, 2002 Not sure if this still applies: FileMaker Pro 3.0, 4.0, 4.1 There is a maximum of 168 nests allowed in a single IF or CASE statement. In any case (haha), you'd be insane to do this as a calculation when a lookup file is SOOOO much easier. It's also far easier to maintain, although I don't suppose counties change often. But new zip codes do come along now and then, and it's a snap to add a new record to a counties/zips database. In fact, I bet you could probably find one already done if you poke around a little. Sorry I don't have time right now to search.
RussBaker Posted March 26, 2002 Posted March 26, 2002 DEFINITELY go the lookup route. Its also much easier when you need to update your zip code database. In the land of Oz, Australia Post has a website from which you can download all the postcodes so its easy to keep up-to-date. I assume there would be something similar over your way. Russ Baker
Recommended Posts
This topic is 8282 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