Lookup fields that populate other text boxes on forms

  • Thread starter Thread starter Pamela
  • Start date Start date
P

Pamela

I have a form with a field that when a user enters a city
another box is populated with the county based on the city
being looked up in a separate table and then the county
associated with it is returned to the form.

However, the county is only VIEWED on the form. I want to
be able to save the county - that is looked up and placed
in the field on the form - back to a table. Right now it
is only viewed in the form, nothing is saved to a table.

How do I do this? ? ?
 
I have a form with a field that when a user enters a city
another box is populated with the county based on the city
being looked up in a separate table and then the county
associated with it is returned to the form.

However, the county is only VIEWED on the form. I want to
be able to save the county - that is looked up and placed
in the field on the form - back to a table. Right now it
is only viewed in the form, nothing is saved to a table.

How do I do this? ? ?

If - and it's a REALLY BIG IF! - you in fact want to store the county
information redundantly in this second table (bear in mind you can
always use a Query or a combo box or a DLookUp to find it), you need
to "push" the value into a bound textbox in the AfterUpdate event of
the combo. Something like

Me!txtCounty = Me!cboCity.Column(n)

where (n) is the *zero based* subscript of the field in the combo's
rowsource containing the county.
 
Back
Top