Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

This is bound to be on here somewhere, but I can't find it after doing several searches. How do I get a zip code field to produce XXXXX-XXXX if the last 4 digits are entered and just the first 5 digits without the - if that's all that's entered?

Posted

you could also do an auto-calc (with replace) for your zip code field:

If(PatternCount(ZipCode; "-") = 0; Left(ZipCode; 5) & "-" & Right(ZipCode; 4); ZipCode)

This will automatically replace the user's input once they exit the field.

Martha

Posted

I like to use the Auto Enter as Martha has posted.

However, you need to modify your calculation so that the = sign doesn't get included if the field 2 doesn't have data. something like this:

Case ( IsEmpty ( Zip_4 ) ; Zip_5 ; Zip_5 & "-" & Zip_4 )

HTH

Lee

Posted

The reason that didn't work, is they are two different approaches to the same thing.

I took a 3 field approach, because James had provide a calculation for that aproach. What I added was the part to check for a value before posting. Whereas, Martha took a advantage of a change in the Auto Enter Calculation, that allows the calculation to be done in one field.

However, I like the calculation that Matt Willis provided on FMExperts List.

Lee

This topic is 6811 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
×
×
  • Create New...

Important Information

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