fill in other fields from a dropdown list

  • Thread starter Thread starter Michael
  • Start date Start date
M

Michael

I have been away for a while and have forgotten how to populate other fields
once I make a choice from a dropdown list. i.e. choose the customername and
have the address filled in automatically. I have been tying to set the
control field to the address in the customer table and have tried to do a
lookup in the field that will hold all the information with no luck.
thank you
Michael
 
Michael

You can do this two ways.

In your dropdown box that displays the customername add the required fields
to the query and set the property of the combo box so that these fields are
no displayed.

The using afterupdate event do something like this.

me!address = comboname.column(1)

Remember the columns count from 0 i.e. customername is column 0.

Alternatively

Use a dlookup function, but make sure you have a customer id that is unique
for each customer to cater for duplicate names etc.

Using your query have fields called customer id and customername. Hide
customer id

me!address=dlookup("address","table customer","customer_id =
comboname.column(0)")
 
thanks Allan for the answer
Michael
Allan Murphy said:
Michael

You can do this two ways.

In your dropdown box that displays the customername add the required
fields
to the query and set the property of the combo box so that these fields
are
no displayed.

The using afterupdate event do something like this.

me!address = comboname.column(1)

Remember the columns count from 0 i.e. customername is column 0.

Alternatively

Use a dlookup function, but make sure you have a customer id that is
unique
for each customer to cater for duplicate names etc.

Using your query have fields called customer id and customername. Hide
customer id

me!address=dlookup("address","table customer","customer_id =
comboname.column(0)")
 
Back
Top