mnamo
01-27-2002, 04:58 PM
Hi.
I have a data entry form that contains a zip code field.
What I need to be able to do is to have that zipcode be looked up in a separate zipcode table and return the city and state values associated with that zipcode to the data entry form. This in turn would be entered into the table as part of the record's information.
Any help you can provide will be greatly appreciated!!
Matt
Pat Hartman
01-28-2002, 04:20 AM
If a zip code can only relate to a single city and state, there is NO reason to store the city and state. You can always join to the zip code table to obtain the other information whenever you need it.
To show city/state on the form (but not store it in your table), use Access' auto-lookup feature. Change the form's recordsource query to join to the zip code table to obtain the city and state fields. Use a combo on the form to choose the zip code. When a zip code is selected from the combo, Access will automatically display the city and state in their respective controls. These controls should be set to enabled = no, locked = yes, and tab stop = no since you don't want to allow updates to these fields from this form.
mnamo
01-28-2002, 04:32 AM
Thanks for the help, Pat!
However, I need a little clarification if you can. (I am a Network Admin/Webmaster/Security Pro - so Access is something a tad outside of my normal experience but I have been tasked with this job and so I need to do it!!)
You mentioned that I need to change the form's recordsource query. How do I do that? I think I figured out how to do the Auto-Lookup, but I need it to look up the zip code from a list of about 53,000 and then return the associated city and state to the form, and after that to store the zip, city, and state - along with other information - in the table that the form is related to. Can auto-lookup be used for this?
You also mentioned the use of a Combo. Does this mean that the data entry personnel are going to have to click the drop down with their mouse and scroll through to find the zipcode or can they just type it in and it will auto-fill as they go, so to speak? If it is the drop-down method, this could get quite time-consuming with 53,000 records!!!
As you can see, I am extremely dense when it comes to programming. Please help me!!
Matt
Rich_Lovina
01-28-2002, 09:05 AM
Have a look at Northwinds your sample database. Have a look at the forms there, and use your help. Also suggest Searches in this Forum with "Lookup", "RecordSource", etc.
Also go through the MS KnowledgeBase where there are many answers for you to research. It takes time, but you'll get there,