combo box question

J

joyo

Hi,

I have a combo box which have two fields, "county ID"
and "county name". I would like to display two fields in
drop down list, but only display county name in combo box
field after user select one. I searched our newsgroup and
found posts regarding this issue. I changed the "column
count" to 2 or 3, and I also tried to chang the "bound
column" to 1 or 2. It still shows the ID in combo box
field. what's the problem?

Thanks

joyo
 
A

Allen Browne

The combo can only display one value when it is not dropped down.

You could work around that by displaying the other value in a text box
beside the combo. Set the Control Source to:
=[MyCombo].[Column](1)

Note that the first column in the combo is called Column(0).
 
D

Dirk Goldgar

joyo said:
Hi,

I have a combo box which have two fields, "county ID"
and "county name". I would like to display two fields in
drop down list, but only display county name in combo box
field after user select one. I searched our newsgroup and
found posts regarding this issue. I changed the "column
count" to 2 or 3, and I also tried to chang the "bound
column" to 1 or 2. It still shows the ID in combo box
field. what's the problem?

Thanks

joyo

ColumnCount: 2
BoundColumn: 1
ColumnWidths: 0"; 1"
 
T

tina

-----Original Message-----
Hi,

I have a combo box which have two fields, "county ID"
and "county name". I would like to display two fields in
drop down list, but only display county name in combo box
field after user select one. I searched our newsgroup and
found posts regarding this issue. I changed the "column
count" to 2 or 3, and I also tried to chang the "bound
column" to 1 or 2. It still shows the ID in combo box
field. what's the problem?

Thanks

joyo
.
allen's alternative is a good one, i've used it often.
if you really want the "county name" to show in the
control after it is selected, there's only one other
solution i can think of:

first column: "county id", col width 0"
second column: "county name", col width 1" (or whatever)
third column: "county id", col width .5" (or whatever)

you can sort by id or by name. the first "visible" column
will be county name (which will also show in the control
once it's selected), and the second "visible" column will
be county id.
 
D

Dirk Goldgar

Dirk Goldgar said:
ColumnCount: 2
BoundColumn: 1
ColumnWidths: 0"; 1"

Tina's right -- I forgot that you want to see both columns in the
dropdown list, and for that you're going to need the ID column included
twice: once with 0 width, once with nonzero width.
 

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