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.

Postal code auto poulate city/state

Featured Replies

Hi,

Is there a db out there that I can import with all the US postal codes and corresponding cities/states? I would like my user to plug in the Postal Code and have the city and state fields auto populate. I can do the relationship easily enough, I just need to find a db that I can purchase/download...

Thanks,

PF

Edited by Guest

This topic comes up from time to time. Do a search of the Forum using [color:blue]"Zip Codes" (include the quotes), and you will get plenty of hits.

Start with this one and see if it doesn't help. Link

HTH

Lee

  • Author

Thank you.

I did a search and purchased a db with all the postal codes and a quarterly update for 2 years. Then joined it to my contacts list via the zip code so all the user has to do is plug in the zip and tab on to the next field. The city and state automatically drops in to the related fields.

One thing I did learn the hard way was to protect the city and state fileds from data entry and remove them from the tab order. Before doing so I inadvertantly deleted a couple of cities and states... A quick re-import seems to have fixed the deleted data. My only trouble is that now there is a chance that the user can enter an invalid zip code and move on, thus leaving the city and state empty.

you can validate the data entered ...

say you create a value list from all of the postcodes in the database ... then you tell the field that your user enters the postcode/zip in, that the code must be a member of that value list.

you can allow them to override this if need be.

best

Stuart

  • Author

Thanks,

I'll give it a go in the AM.

  • Author

Hi, Stuart,

I changed the field to validate from a value list defined by the zip codes in the zip code table and worked great locally. But... Since this is an IWP solution it killed the data input process because there are so many zip codes for it to sort through and the connection froze.

Dang.

PF

What about a relationship between the entry field and postcode database

The validation could just check if a related value exists?

(its probably the same relationship as the auto entry/lookup one)

Should this will stop IWP from locking up and should be much quicker.

  • Author

Isn't that what I have now?

Guest (customer...) table has G_ZipCode

But the City and State are from the zipguest table with the Zip Code being the key/foriegn fields.

zipguest::city and zipguest::state

When the user commits the record in IWP it fills in the City and State, but by then it is too late , the erroneous Zip Code is already entered and the user is headed back to the transactions table where they were working.

Set Error Capture [On]

Allow User Abort [Off]

Set Field [transactions::gLayoutNumber; Get (LayoutNumber)]

Enter Browse Mode []

Go To Layout["GuestDisplayFromTransactions"(Guests)]

New Record/Request

Go to Field [Guests:G_NameFirst

Pause

Then the Save Record Button returns the user to the Transactions page.

Commit Record [No dialog]

Go to Layout [Transactions::gLayoutNumber]

Halt

Maybe I need an Error message. Well, except for the fact that those don't really work in IWP either...

Hmmm.

This is validation...

1. Your user enters the zip

2. The Validation calc validates the entry

3a. If validation fails ... error message and no auto fill

3b. If validation succeeds ... auto entry does its thing

  • Author

Got it. Thanks!

  • 4 months later...

Hi All,

Another newbie here and I have read this topic and have found it interesting and just what I am looking for in my solution.

Unfortunately being a newbie I am having problems understanding and was wondering if anyone could supply a sample of how this works.

I am also not sure how to store the zip/post code and suburb data so it can be recalled :B

I would like to be able to do what PaddyO was doing with the auto fill using drop down menus

I would like my user to plug in the Postal Code and have the city and state fields auto populate.
also not sure on the relationship side.

Any help would be gr8ly appreciated

Thanks in advance

Mac

P.S Have done search on "Zip Codes" and there are no real examples of what is required :confused:

...........................................

Hi Macca,

Here's an example.

PS. The post codes and suburbs are made up lol.

zipz.zip

Thanks Genx just the ticket looks like i have some work ahead tho :B

Thanks again your a champ.

Cheers

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.