When zip code is entered, auto insert city name

A

AlvLin

In Paradox I could link a lookup table to a form so that if I entered the Zip
Code, the City and State name would come up. Can I do this in Access?
 
A

akphidelt

Yes you can and its fairly quite easy. I have this functionality on almost
all my applications now.

Getting the zip code list is simple by just googling for it.

Then once you get it in, the way I use it is by adding click events that
trigger a text box to do a dlookup in to the zip code table and insert the
correct city and state. There are plenty of ways to do it though once you get
the table in.
 
J

John W. Vinson

In Paradox I could link a lookup table to a form so that if I entered the Zip
Code, the City and State name would come up. Can I do this in Access?

Sure, several ways.

One would be to use a Combo Box to select the Zip code. Include the city name
and state code in the combo's rowsource query, and either put textboxes on the
form with control sources like

=cboZip.Column(1)

to pull the second column (it's zero based), i.e. the city name, from the
combo box named cboZip; or use code in the combo box's AfterUpdate event to
"push" the city and state into the textboxes.

Note that some zip codes cover more than one city, although the USPS has a
"preferred" city name in such cases. I live in Parma (83660) and have friends
in Roswell (also 83660) and Adrian (also 83660).
 
M

Mike Painter

AlvLin said:
In Paradox I could link a lookup table to a form so that if I entered
the Zip Code, the City and State name would come up. Can I do this in
Access?
Yes.
One table contains the ZIP, City and state.
The other table contain the zip and whatever other information you need.
Build a query to relate the two and use the query for form and report
design.
This is the "proper" way in a relational data base and requires no coding.
maintable.ZIP, ZIP.City, ZIP.state would be the fields used.
 

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