Please help. Here is the code I am using on a form.
Private Sub ThreeDigZip_AfterUpdate()
Me.City = DLookup("[City]", "tblZips", "[ThreeDigZip] = '" & Me.ThreeDigZip & "'")
Me.State = DLookup("[State]", "tblZips", "[ThreeDigZip] = '" & Me.ThreeDigZip & "'")
End Sub
I want it to automatically put the State and City in when I type in the 3 digit Zip. The first line is working, when I type 850 for the zip it puts Phoenix in the City text box. But it doesn't do it for the state. I want them to do both at once. Can anyone help?
Private Sub ThreeDigZip_AfterUpdate()
Me.City = DLookup("[City]", "tblZips", "[ThreeDigZip] = '" & Me.ThreeDigZip & "'")
Me.State = DLookup("[State]", "tblZips", "[ThreeDigZip] = '" & Me.ThreeDigZip & "'")
End Sub
I want it to automatically put the State and City in when I type in the 3 digit Zip. The first line is working, when I type 850 for the zip it puts Phoenix in the City text box. But it doesn't do it for the state. I want them to do both at once. Can anyone help?