How to create a drop-down list box (not a combo box!)

My understanding is that a list box allows multiple selections but a combo box allows just one selection. For reasons of space I want a list box that has drop-down functionality. The Access 2002 help refers to 'Create a list box, combo box, or drop-down list box' and I assume a drop-down list box is what I need. The instructions are:

3. Click the List Box tool [icon1], the Combo Box tool [icon2], or the Dropdown List tool [icon3] in the toolbox.

I can't see any difference between icon 2 and icon 3, they both look like the Combo Box tool. However, if I use the Combo Box tool I can't find any way to set it up as a drop-down list box (ie, a drop-down that allows the user to click, highlight and accept more than one entry in the drop-down section).

I wonder if Microsoft are using combo box and drop-down list to mean the same thing - a single-select combo box. If so, is there another way to space-save on a form with a list box yet display all the possible selections when required by the user without the need to scroll?

[PS - I know a little vba so could probably cope with a programmatic solution].
ccsgcAsked:
Who is Participating?
 
stevbeConnect With a Mentor Commented:
What is the functional purpose for your multi-selection? I hope you are not trying to store multiple values in a single field :-) If you are using this for filtering data on a form or a report there are a couple of approaches you could use to save space ... pop a seperate form with just the multi-select listbox when they click a button ... I have a report riteria builder ... most of the time I only need to run reports where I own a task record in our application but sometimes my boss likes to run reports on everyone in our group ... what I did in builtind the UI is to make a combobox for when people only need to make 1 selection and put a little button with the    ...   on it just to the right of the combobox and trained everyone that they need to click the button to make *multiple* selections for that particular field. When they click that button a simple form pops up (modal) with a multi-select listboxn and I return the results of their selection back to the main form in the Close event of the multi-select form. I am working on another project where they tend to make many multiple selections and while I have a bit of space they need multiple, multiple selection fields :-) On this project I used subforms bound to temp tables displayed in datasheet and made the data entery control inside the datasheet be a combobox ... this way they get auto-complete and the *entered* list grows and adds the scrollbar automagically because it is a datasheet. Of the two options the first one is more space conservative but the users really like the second one.

Steve
0
 
peter57rConnect With a Mentor Commented:
Hi ccsgc,
In a normal Access form you can use a list box or a combo box.
In a Data Access Page you can use a drop-down list.
If you need multi-select you have to use a listbox.

Pete
0
 
Leigh PurvisConnect With a Mentor Database DeveloperCommented:
It would ultimately have to be just a listbox that is displayed and hidden upon certain conditions.
Sometimes a textbox is placed above a listbox - to give the illusion of a combo type control.
You would have to decide what you wanted displayed in the textbox - as you're selecting multiple values in the list.  A concatenated list of the selected items would be most likely.

(Or you could just have it completely hidden - and a command button to display it for selecting options when the user so desires - then problem then is knowing what's selected when it's hidden.  But if you've a good few items selected - I don't see how a textbox will be much help at that ether.)
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

 
Simon BallConnect With a Mentor Commented:
Private Sub List0_Click()
Dim xheight As Integer

xheight = List0.Height
xheight = xheight * List0.ListCount

List0.Height = xheight
End Sub
0
 
Simon BallCommented:
i got a phone call inbetwen writing question and posting it, my list0 was condensed on the form.  the initial hieght value was 227.
0
 
Simon BallCommented:
on click event not thebest i suppose, as it will fire when selecting...
0
 
ccsgcAuthor Commented:
The functional purpose is to read the list box programatically and put the values in an IN() statement of the SQL to be executed.

Your answers are all pertinent so I will split the points. Thanks for the tips how to rig it. I think the Microsoft online documentation is misleading about the drop down list box - it seems they mean a drop-down-list box (a box that gives a drop-down list) and not a drop-down list-box (a list-box that can be opened from a combo-like control). Thanks again.
0
 
ccsgcAuthor Commented:
I am a newbie on the site. I think I managed to split the points between you (25 each) and a moderator confirms that I closed the question with 4 comments but can't confirm the percentage of points each. Let me know if you didn't get them.
0
 
Simon BallCommented:
i think it worked because it says all the assisted answers in green.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.