I have created 2 combo boxes on a form. One is Customer
ID and the second is Customer Name. I want Customer name
to be filled in automatically when I type/select Customer
ID. How do I synchronize the two boxes? Thanks for any
advice that can be given.
Is the first combo box bound to a field? If you are storing the "Customer ID"
and the ID is contained within the same table as the "Customer Name", you
needn't use any more than a textbox to *display* the customer name as a
"calculated field". Add the "Customer Name" to the fields contained within the
first combo box's rowsource query or SELECT statement (found in the combo box's
"Row Source" property) and set the following combo box properties:
Column Count: 2
Column Widths: .25;0
(You can also set the first "column width" to the width of the combo box
if that is a larger value)
Now, add a textbox to your form, where your second combo box was placed, and set
its "control source" property to:
=[Combo1].Column(1)
Replace "Combo1" with the name of your combo box. (Note that the columns in a
combo box are indexed starting with zero, so first column is 0, the second is 1,
etc..) Your textbox will now display the value of the second column in the combo
box, namely the "Customer Name" value.