Hiding scroll bar in combo box

P

Peter Hallett

When a parameter is selected from a combo box, it is often subsequently
employed to determine associated values. A selected surname, for example,
may be used to find an associated ID and/or invoice number.

As a simpler, and presumably more efficient, alternative to using a series
of DLookups, the combo box can be bound not just to the name field of a table
or query, but to the other required fields as well. Having selected the
surname, the associated values can then be read directly as Name.Column(1),
Name.Column(2), etc., where the surname itself is in the default column,
Name.Column(0), or simply Name.

This works quite well if the columns are made wider than the width of the
combo box, thus effectively hiding the additional fields. One snag, however,
is that a horizontal scroll bar is automatically added to the bottom of the
drop-down list which, in such applications, is generally superfluous and can
be distracting. Unlike in form design, there does not appear to be an
obvious mechanism for hiding this feature. Can it be done?
 
C

Clifford Bass

Hi Peter,

Instead of making the columns wider than the list, just set the widths
of those you want to hide to 0.

Clifford Bass
 
G

golfinray

If you right click on the box and get properties, there should be a setting
for scroll bars. You can select vertical, horizontal, both or neither.
 
P

Peter Hallett

Thanks, Clifford. The solution sounds a good one but I can only see an
option to change column widths globally. The first column, showing the name,
has of course to retain the width of the combo box and I can't at present see
how the others can be differentially set to zero width. Have I missed
something?
 
P

Peter Hallett

Such settings are certainly available for forms but I don't see anything
similar for combo boxes.
 
C

Clifford Bass

Hi Peter,

In the Column Widths property enter the width of each column, separated
by a semicolon. So if you have three columns and only want the first column
to show and be 2.5" wide you would enter:

2.5;0;0

If you system uses inches it will adjust to show as:

2.5";0";0"

Clifford Bass
 
P

Peter Hallett

Thank you once again, Clifford. That is, of course, a very neat and
appropriate solution. I will apply it right away.
 

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