Combo box with both fields showing

  • Thread starter Thread starter MikeA
  • Start date Start date
M

MikeA

I thought this would be a simple thing to do: I have a
main table that has quite a few fields with codes. The
codes have their descriptions stored in other tables.

I want the user to type in the code or select from a drop-
down box (combo box) then have it update a display only
field showing the description. Simple example would be
picking a dept code and department name to assign to an
employee in the main table.

I created the combo box, and used the wizard to run a
query against the lookup table. Selected both code and
description and then store the code in the main table. I'm
able to get the combo to fill with the code and
description for the user to pick from. But when you tab
out, it only displays the code: no description.

I also tried to create some VB code for On Update of the
dept code to set the value of the display only description
field. But I couldn't figure out the syntax.

Which way should I do this. And why isn't it intuitive to
me? Thanks for your help.

Mike A.
 
A combo box will only display the first visible column in the "text box"
portion of the combo box. You can display many columns in the dropdown list.

To show other columns, use a textbox next to the combo box, and then use the
method shown at this URL to do what you seek:

http://www.mvps.org/access/forms/frm0058.htm
 
Back
Top