Pulling zip codes to populate a combo

  • Thread starter Thread starter Earl
  • Start date Start date
E

Earl

I'd like to populate zip codes dynamically out of the database zip code
table, but frankly there are over 70,000 zip codes in the U.S. so loading
the entire table into the combo doesn't seem feasible. I'm curious what
criteria others have used to decide how, when, and how many zip codes to
populate the combo with. I could envision waiting until the city and/or
state are selected to make the population, but at the same time, that
doesn't seem like a fast enough response for such a "trivial" piece of data.
 
Earl,

your right about populating a combobox with 70,000 being a bad idea. we
NEVER let the user enter city and state, then do a look up on zipcode -
rather we let the user enter the zipcode and then populate the city and
state from a query using the zipcode. your requirements may dictate a
different approach.

as for US postal concerns, city and state are eye-candy when a valid zipcode
is present. for any given city, there may be many zipcodes, but for every
zipcode, there is one right city, and possibly many alternative - i.e. zip
to city is deterministic, the other way is not!

regards
roy fine
 
Excellent points Roy. So you are essentially saying you enter the zip code
freestyle and requires no associated table or ID (except the city and state
tables)?
 
Hi Earl,

Based on my understanding, Roy means that we can let the user input zip
code and make the application search for the corresponding state and city
name.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
Well, I took that and ran with it. Consolidated the city, state, and zip
lookup tables into one, with a single primary key, configured the UI so the
user could only enter a zip code, then when the 5th keystroke is entered, a
lookup is executed for the city and state name using a datareader. It's fast
enough. Thanks Kevin.
 
Back
Top