2 col combo

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

John Vinson

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

Iftekhar

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).
 
V

Van T. Dinh

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.
 

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

Top