List Drop Down Box

G

Guest

I am working in Access 2003. I am in need of finding out if there is a way I
can select multiple items out of a list drop down box or what do I have to do
to be able to select multiple items from one drop down box.
 
D

Dirk Goldgar

In
William said:
I am working in Access 2003. I am in need of finding out if there is
a way I can select multiple items out of a list drop down box or what
do I have to do to be able to select multiple items from one drop
down box.

You can't directly use a combo box to select more than one item at a
time. I can think of two ways to work around this limitation.

The simplest way it to maintain a separate list (maybe a related table)
of the items selected. You'd select them one at a time, and as each is
selected, you add it to the table. The trick would be to identify the
items that were already selected. You could show them in a companion
list box, and use some action on that list box to delete items from the
list. Or you could probably build a rowsource query for the combo box
that would include a column indicating whether the item was already
selected. You could then show that column as a second column in the
combo box's dropdown list.

The other way I can think of is to build your own pseudo-combo-box,
consisting of a text box, a multi-select list box, and a small command
button. The list box would be hidden most of the time; you would have
code that displays it when the user clicks on the command button. The
same command button would also hide the list, if you click it when the
list is already displayed. This approach could get complicated,
depending on how much of the built-in functionality of a combo box you
wanted to implement.

Be aware that you can't easily, and should not want to, store multiple
values in one field. Instead, use a related table to store the selected
values. If you're using a multi-select list box to select the values, I
have sample code that loads and unloads a related table based on what is
selected in a multi-select list box.
 

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