Lookups

A

Adam

Hi,

When entering data into a form to add a new customer,
such as Name, Address, Phone, etc, etc, I'd like to have
some fields automatically (not using defaults) filled
with data based on what was inputted into another field
on the same form.

So, for example, if I type a particular city in the City
field, I want the corresponding postcode to show.

On the form I use a drop down combo box showing all
existing cities listed (ie previously entered customers),
and another text field for the postcode. The underlying
table is a table of customers and the combo box looks up
the available cities in the table. Because it is
not "Limit to List" I'm able to add new cities along the
way. But where there are existing cities in the field I
select it, and then I'd like to see the corresponding
postcode appear as well.

How do I do this, may I ask?

Many thanks.

aj
 
K

Kevin @ 3NF

In the afterUpdate event of the City Dropdown, you will need to add code
that runs a query based on the city selected, and set the post code value to
the result of that query. A DLookup may work as well.

One question though....if the city is Dallas, TX, how will you pick the
correct zip code from the dozens available in Dallas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top