Simple questionabout a Combo box.

  • Thread starter Thread starter Frank Martin
  • Start date Start date
F

Frank Martin

I have altered the display of a 2-column combo box to make the second column
of the display as the "bound column" and this works OK.

But I need the first column as the first column displayed in the dropdown
but the second column to remain in the combo when finished.

Please help, Frank
 
Generally when I create combo boxes the primary key is the first field
(bound column) to the combo box and then I place the field I want to remain
shown in the combo box as the second field. If the primary key does not need
to be shown, I set my field size to 0;1". Where zero hides the field. I set
my column count to 2 as in reality there are two fields.

Having said the above, whatever is the first field set in the combo box is
the one that will always be shown to the user, unless you do the above.

As Doug said reverse the order.
 
Frank said:
I have altered the display of a 2-column combo box to make the second
column of the display as the "bound column" and this works OK.

But I need the first column as the first column displayed in the
dropdown but the second column to remain in the combo when finished.

Please help, Frank

Normally you would just reverse the order of the columns on the RowSource query.
If there is some reason why you want them in the current order in the drop-down
list you could add a third column and make it have the same field as your
current second column. Make the new column first in the column order and then
set its width to a very small (but larger than zero) amount. The user won't see
it, but it will still be used as the display when the ComboBox is not dropped.

This will mean that the "AutoExpand" feature of the ComboBox will react to the
column that the user can't see which might be confusing.
 
Thanks, this does work, but introduces a new problem

This combo is used to select a product for display in a chart, and a small
example of the combo display follows:
Col1 Col2
Green soap 5L
Green Soap 10L
Green Soap 15L
Green Soap 200L

Of course the combo selects the first of this list no matter which is
selected and so defaults always to "Green Soap 5L".

Obviously the combo wants a unique record to use, but I have never figured
out how to put an incrementing numerical field into the RowSource query.

However I can simply add the two columns together (somehow) to form another,
giving a defacto unique row marker and then remove its tick in the query
column.

Please advise if this is permissable and will not cause problems later.

(Previously the RowSource columns were:
5L Green Soap
10L Green Soap
200L Green Soap
etc, and this order was changed in a makeover of the "tblProducts" to give
better sorting characteristics.)

Please help, Frank
 
Back
Top