Combo box problem

C

cleaver

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.
 
M

Matthew

My first reaction is why not display both in the first
combo box. I guess you have some reason.

See Microsoft Knowledge Base articles on synching combo
bozes

KB 209595 and 209576

Matthew
 
M

May

put it after_update
Dim strname
strname = DLookup("name", "table1", "[Text]='"&Combo0&"'")
Combo2 = strname

May
MCP in Access and SQL Server
 
B

Bruce M. Thompson

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.
 

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

MS Project Center-Autolink column fields 0
Combo or list box 0
Combo or list box 0
Weekly Report 2
Combo box 0
Combo box synch question 1
Style Gallery View 3
Mailmerge - page breaking to new customer 1

Top