import zipcodes

D

Danielle

I have an Excel spreadsheet that has a listing of zipcodes, towns, and counties. Is there anyway to import this to my MS Access database so that when I enter a city, the state, zipcode and county will automatically populate so I don't have to type them in each time? For example, whenever I put in city "Harwich", it would auto populate the fields for state with "MA", zipcode field with "02645", and county "Barnstable".
I have looked at the help icon but it didn't make sense to me. Any suggestions??
 
R

Ron Weiner

You might wnt to re-think the whole idea of entering a city and having the
State and Zip fields get populated automatically. What one of the dozen of
Zip codes would you use if someone typed in Boston? What state would you
use if the user typed in Springfield? MA, MO, PA??? Well you get the idea.

A better stragety might be to have the user type in the Zip and you populate
the City and County and State fields. You will need a table with 4 fields
Zip, City, County, State. You will also have to deal with how the table
gets updated when you get a new zip code, or when the same zip code might
refer to more than one town.

Basically IMHO this is a can of worms that I solved in the past by doing
nothing, and just letting the users enter the information.

Ron W

Danielle said:
I have an Excel spreadsheet that has a listing of zipcodes, towns, and
counties. Is there anyway to import this to my MS Access database so that
when I enter a city, the state, zipcode and county will automatically
populate so I don't have to type them in each time? For example, whenever I
put in city "Harwich", it would auto populate the fields for state with
"MA", zipcode field with "02645", and county "Barnstable".
I have looked at the help icon but it didn't make sense to me. Any
suggestions??
 
M

Mike Painter

Ron Weiner said:
You might wnt to re-think the whole idea of entering a city and having the
State and Zip fields get populated automatically. What one of the dozen of
Zip codes would you use if someone typed in Boston? What state would you
use if the user typed in Springfield? MA, MO, PA??? Well you get the idea.

A better stragety might be to have the user type in the Zip and you populate
the City and County and State fields. You will need a table with 4 fields
Zip, City, County, State. You will also have to deal with how the table
gets updated when you get a new zip code, or when the same zip code might
refer to more than one town.

Basically IMHO this is a can of worms that I solved in the past by doing
nothing, and just letting the users enter the information.

Entering the ZIP code is the best solution since a misspelled city name will
cause a problem.
Presenting a combobox or list box based on a query which select for that
city is good.
I'd probably check to see if the ZIP is unique, then pop a modal form to
pick from if there were more than one. You could do the same with a list or
combo box if there was enough real estate on the form.
 
D

Danielle

ok. everyone is right. so how do i do it? if i put in the zipcode, how do i get the city, state, and county to auto populate? i have a spreadsheet which breaks it all down by zipcode. how can i get that information into the Access database without having to manually enter it all each time? For example, every time i enter 02601, the city Hyannis, state MA, and county Barnstable fill in? Please help... Thanks./
 
M

Mike Painter

Danielle said:
ok. everyone is right. so how do i do it? if i put in the zipcode, how
do i get the city, state, and county to auto populate? i have a spreadsheet
which breaks it all down by zipcode. how can i get that information into
the Access database without having to manually enter it all each time? For
example, every time i enter 02601, the city Hyannis, state MA, and county
Barnstable fill in? Please help... Thanks./

After importing the ZIP code into a table you add the zipcode field to your
main table.
Then create a query which links your main table with the zip code table and
use this query in all forms and reports.
Help has information on this and the Northwind database has many examples.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top