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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Zip Code Look-up

Status
Not open for further replies.

ksimmsa

Programmer
Feb 6, 2004
22
US
I have a form that you enter various zip codes and it gives you the distance between the to zip codes. I need to be able to enter numerous zip codes into the form and return the nearest city. The code I am using is:

Private Sub ZipCode1_Exit(Cancel As Integer)
If ZipCode1 <> "" Then
stLinkCriteria = "[zipcode] = '" & Trim(Me.ZipCode1) & "'"
Me.City1 = DLookup("[City]", "dbo_zips", stLinkCriteria)
Me.State1 = DLookup("[State]", "dbo_zips", stLinkCriteria)
Me.Long1 = DLookup("[long]", "dbo_zips", stLinkCriteria)
Me.Lat1 = DLookup("[lat]", "dbo_zips", stLinkCriteria)
End If

End Sub

Thanks in advance for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top