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!

Autofill city and state from zip code

Status
Not open for further replies.

AllenPARI

Technical User
Feb 16, 2011
2
US
thread702-656182

I am trying to autofill city and state fields on a form after entering the zip code. I am new to Access and am daunted by code (I can't even figure out what me! means) so have been trying to use the solution offered by Fancy Prairie in the above thread with no luck. Any help out there? Thanks!

Allen
 

So, what is it that you need help with?
What have you got to this point?


Randy
 
AllenPARI,
Ditto what randy700 said. You haven't even told us if you have created the basic table of all zipcodes with the city and state fields. The ZipCode would need to be the primary key.

Duane
Hook'D on Access
MS Access MVP
 
Duane:
I don't think that the Zip Code Can be the primary key beacuse there can be two towns that have the same zip code.
 
PWise,
Thanks for the reminder. I was hoping AllenPARI would possibly discover this on his own when attempting to set the primary key. It might be a situation where this won't be an issue with his cities at this time but could cause issues in the future.

Duane
Hook'D on Access
MS Access MVP
 
Hello all, thanks for the responses! Sorry about the vagueness of my post. For the sake of simplicity I work for a non-profit in Rhode Island/S.E. Massachusetts that recycles durable medical equipment, providing inexpensive wheelchairs to seniors. I am developing an inventory/data collection/sales database. At this point I have a zipcode table for Rhode Island with four fields: Autonumber ID, Zip, Town and State. I also have a customer table I would like to populate through a form. I have set the Zip Code entry on the form as a combo box (not the table as I've read is a no-no) referencing the zipcode table with all four fields in the query, zip code first. When I try to set the control source in the town and state boxes on the form as the refernced thread descibes it just will not work. So is it me and I'm missing some nuance or should I just go another route and learn about Dlookups? Thanks again in advance.
 
Why not practice proper relational database technique and only store the Autonumber ID value from the zipcode table? The zip, city, and state will be available as long as you have stored the ID.


Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top