Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using ZIP code to get city and state

Status
Not open for further replies.

mshefferVT

Technical User
Jul 9, 2002
5
US
I have three combo boxes [ZIP] [CITY] [STATE]. I also have a table with every Zip code linked to a city, state, county. The Zip code table has four columns [ZIP_ID] [CITY] [STATE] [COUNTY]. When I enter in the Zip code in the [ZIP] combo box on the form, I want the other two combo boxes to echo ZIP_DB.CITY and ZIP_DB.STATE respectivly. How can I go about doing this?

Thanks in advance!
Matt
 
You can change the rowsource of the appropriate comboboxes in code.

eg

cboCity.RowSource = "SELECT tblZIP.City FROM tblZIP WHERE tblZIP.ZIPCode = '" & cboZip.value & "';"

You will have to change variables etc, but you can get the idea.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top