Re: Zip Code Lookup
- From: John Spencer <spencer@xxxxxxxxx>
- Date: Tue, 17 Jun 2008 08:15:13 -0400
Is that not working? It appears that it should work.
Are you getting any errors?
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
Bill wrote:
I'm trying to do a zip code look up where the user enters a zip code then the city and state is populated base on a table. My table is called ZIP_CODES and the table which will be holding all data is "Address". When the user enters the zip code into the form I want the city and state to autofill. Here's what I have:.
Private Sub Zip_Code_AfterUpdate()
Dim rsCurr As DAO.Recordset
Dim strSql As String
strSql = "SELECT City, State " & _
"FROM tblZIP_CODES " & _
"WHERE Left(Zip_Code, 5) = '" & Left(txtZip_Code.Value, 5) & "'"
Set rsCurr = CurrentDb().OpenRecordset(strSql)
If rsCurr.EOF = False Then
State = rsCurr!State
txtCity = rsCurr!City
End If
End Sub
Thanks for the help.
Bill
- Prev by Date: Re: SendObject with multiple objects
- Next by Date: RE: Showing total value of column in a multiselect list box in a text
- Previous by thread: Re: SendObject with multiple objects
- Next by thread: RE: Showing total value of column in a multiselect list box in a text
- Index(es):
Relevant Pages
|