Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

need calc that auto enters STATE based on area code field [Beta-8]

Featured Replies

Can anyone point me where I can find such a calc?

There has to one out there...this is such a common tool for DB's...I don't know why FM just doesn't provide it...

Edited by Guest

This topic has been discussed a few times in the past.

I did a search for "Area Code" and it returned this recent post among the 64 hits , Click Here

I'm sure if you use "Zip Code" you would get a lot more hits.

HTH

Lee

:cool:

  • Author

OK, I have explored a solution but can't get it to work...

I have broken it down to creating two new calculations:

1) Create a calc field called "EXTRACT AREA CODE"

Middle(Main Phone;Position(Main Phone;" ";1;1)+1;3)

This baby goes out and extracts the first three numbers (area code) from the string text in the field (Main Phone).

2) CREATE a CALC field called "INSEERT AREA CODE" that is a nested IF statement that checks to see if my MAIN Area Code field is empty, and if it is, inserts the "extracted" area code.

Case( IsEmpty(Main Area Code); "extract area code"; "")

BUt, unfortunately this solution is not working...

any ideas people???

It all depends on how your phone field is formatted. I am guessing you have local and long distance numbers - perhaps you shoud start by examining how many digits are there (using the Length() function).

If I had to have this functionality, I would make a separate field for the area code, and enforce a tighter discipline for data entry in general. There's too much room for ambiguity here: for example, it could be assumed that a number with more than 11 digits is an international number; then alongs comes the user that enters "123-456-7890, ext.2020".

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.