HOW DO I GET A FIELD TO AUTOMATICALLY FILL IN?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form called "New Order Input Form". On that form, the user selects
the zipcode from a combobox field called "Delivery Zip Code". This field has
a row source of a query called "qryZipCodes".

On the same form I have a field called "Delivery City". I want Delivery
City to fill in automatically based on what the user chooses in "Delivery Zip
Code".

The table called "Zip Codes" has the list of the zip codes a user can select
in the form and the matching cities.

How do I get the "Delivery City" to fill in automatically?
Thanks for your help.
 
Hi Bryan

Add the City field to the rowsource of your combobox and hide it if you want
(set the column widths to 1"; 0")

Your combobox rowsource should then consist of ZipCode and City with the
city being invisible to the user

On the On Change event of the combobox (in the VBA window) type the
following:

Me.nameocontroltoholdDeliveryCityName = me.nameofcombobox.column(1)

HTH

Debra
 
Debra, it WORKED!

Thanks

Debra Farnham said:
Hi Bryan

Add the City field to the rowsource of your combobox and hide it if you want
(set the column widths to 1"; 0")

Your combobox rowsource should then consist of ZipCode and City with the
city being invisible to the user

On the On Change event of the combobox (in the VBA window) type the
following:

Me.nameocontroltoholdDeliveryCityName = me.nameofcombobox.column(1)

HTH

Debra
 
Back
Top