2 col combo

  • Thread starter Thread starter rob p
  • Start date Start date
R

rob p

I have a combo field in a table set up like this: "1 bank name", etc. This
is an auto number and then a name field.

I made the combo box have two columns but it is not displaying the way I
want. I want it to show the list of names just as I have in quotes, the
number and the name field. I get only one or the other. thanks in advance.
 
I have a combo field in a table set up like this: "1 bank name", etc. This
is an auto number and then a name field.

I made the combo box have two columns but it is not displaying the way I
want. I want it to show the list of names just as I have in quotes, the
number and the name field. I get only one or the other. thanks in advance.

A combo will only show multiple columns when it's dropped down; when
it's not, it will show only the first non-zero width column. If (and I
really have to question this!) you want to show the Autonumber value,
realizing that autonumbers are not sequential, not gapless, and can
become random, then include a calculated field in the Combo's
rowsource concatenating the two fields:

SELECT BankID, [BankID] & " " & [BankName] AS Showname
FROM yourtable ORDER BY <whatever>;

as the rowsource of your combo.
 
You can have both the columns visible if you just change
the ColumnCount property to 2 and ColumnWidhts to 0.6;3
(as an example).
 
This only shows in the drop-down list which is not what the OP asked (the
Text component of the ComboBox).

See John Vinson's answer.
 
Back
Top