R
Ray
I can get my form to auto populate the City and State, but
not with the correct info. It pulls the first City and
State listed from the Zipcodes table for every zipcode you
choose in the form. Can you check my code??
zipcodes
zip
state
city
customer_tracking
fname
lname
address
city
state
zip
(The following code is used by the 'zip' field under
the 'AfterUpdate' control in a form
called 'customer_tracking'.)
Private Sub zip_AfterUpdate()
Dim varState, varCity As Variant
varState = DLookup("State", "zipcodes", "zip =[Zip] ")
varCity = DLookup("City", "zipcodes", "zip =[Zip] ")
If (Not IsNull(varState)) Then Me![state] = varState
If (Not IsNull(varCity)) Then Me![city] = varCity
End Sub
not with the correct info. It pulls the first City and
State listed from the Zipcodes table for every zipcode you
choose in the form. Can you check my code??
zipcodes
zip
state
city
customer_tracking
fname
lname
address
city
state
zip
(The following code is used by the 'zip' field under
the 'AfterUpdate' control in a form
called 'customer_tracking'.)
Private Sub zip_AfterUpdate()
Dim varState, varCity As Variant
varState = DLookup("State", "zipcodes", "zip =[Zip] ")
varCity = DLookup("City", "zipcodes", "zip =[Zip] ")
If (Not IsNull(varState)) Then Me![state] = varState
If (Not IsNull(varCity)) Then Me![city] = varCity
End Sub