combo box and what it shows

J

JohnE

I have a situation in which the PK of the record also is the number that is
used to reference it. The record PK will also have text name associated with
it in the name field. A combobox is used to find the record, the bookmark
way. The combobox has the 2 fields displayed when open but when the cbo
closes, the PK is showing in the cbo, not the text name. I set up a txt
control next to the cbo to display the PK by using the after update event
with column(0). What the users are wanting is to have the number show in the
text box (which is done) but the text name in the cbo. The bound column is
the PK field. Even if I make the name the bound column, since the PK column
is the far left column of the cbo, I still get the PK in the cbo. I thought
about using a txtbox over the top of the cbo ...
Has anyone any thoughts on how this can be remedied to work?
Any assistance welcomed.
Thanks ... John
 
J

John W. Vinson

I have a situation in which the PK of the record also is the number that is
used to reference it. The record PK will also have text name associated with
it in the name field. A combobox is used to find the record, the bookmark
way. The combobox has the 2 fields displayed when open but when the cbo
closes, the PK is showing in the cbo, not the text name. I set up a txt
control next to the cbo to display the PK by using the after update event
with column(0). What the users are wanting is to have the number show in the
text box (which is done) but the text name in the cbo. The bound column is
the PK field. Even if I make the name the bound column, since the PK column
is the far left column of the cbo, I still get the PK in the cbo. I thought
about using a txtbox over the top of the cbo ...
Has anyone any thoughts on how this can be remedied to work?
Any assistance welcomed.
Thanks ... John

Simply set the ColumnWidths property of the combo to have the PK's width set
to zero, or reverse the order of the fields in the combo's rowsource query.
The first nonzero width field (which need not be, and generally won't be, the
bound column) is the one that's displayed.
 

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