Can state automatically enter when city is entered?

M

Mariah

We have a form put together for entering information about customers.
Is there a way to make a form automatically enter a state in the state field
when a city is entered in the city field? For example, if "Chicago" is
entered into the city field, can the database be programmed to automatically
enter "IL" into the state field? Would also like the option of overriding
the state manually, just in case.

Thanks for your help!
 
T

Tom Lake

Mariah said:
We have a form put together for entering information about customers.
Is there a way to make a form automatically enter a state in the state
field
when a city is entered in the city field? For example, if "Chicago" is
entered into the city field, can the database be programmed to
automatically
enter "IL" into the state field? Would also like the option of overriding
the state manually, just in case.

Thanks for your help!

Sure. Create a table with all the city names in one column and one column
with
all state names. You only need one state for each city even if the city is a
common
one like Springfield. The user will have to type in any state name other
than the one
for which you have an entry.

In the After Update event of the city field, use a DLookup to return the
state name
based on the city name and set the state text box on the form equal to that.

Tom lake
 
Top