Making multiple selections in a drop-down list/menu

G

Guest

Help! I am trying to create a drop-down list from which a user can make more
two or more selections, both which will appear in the "response box." For
example, I want to create a box that askes the user to "Choose ALL that
apply." The user then has the option of highlighting two or more items in the
drop-down list by holding down the "Control" or "Shift" key. Once the user
has made his/her selections, and hits "Enter," the selections appear in the
response/answer box.

Any assistance will be appreciated.
 
F

fredg

Help! I am trying to create a drop-down list from which a user can make more
two or more selections, both which will appear in the "response box." For
example, I want to create a box that askes the user to "Choose ALL that
apply." The user then has the option of highlighting two or more items in the
drop-down list by holding down the "Control" or "Shift" key. Once the user
has made his/her selections, and hits "Enter," the selections appear in the
response/answer box.

Any assistance will be appreciated.

A Drop-down list?
A control that drops down is a combo box.
A combo box is limited to 1 selection.

You can use a List box control (which does not drop down).
Set it's MultiSelect property to either Simple or Extended.

You then need code to extract the selected items.

Dim varItem as Variant
Dim strResult as String
For Each varItem In ListBoxName.ItemsSelected
strResult = strResult & Me!ListBoxName.ItemData(varItem) & ", "
Next varItem
strResult = Left(strResult, Len(strResult) - 2)
[SomeControl] = strResult

This should result in a strResult variable that looks like:
Joe, Steve, Anne, Mary, John
 
G

Guest

Wow, that's almost exactly what I'm looking for. The next half of the
question then becomes, how do I get it to show that I've selected those items
next time I have that record up in the same form?

finally, is there a way to then take the data and have it displayed on a
report with one item per line. for example, I've got a list of areas where a
memo could be routed. In the memo form, I'd have the user choose a number of
areas to route copies to, which need to be on separate lines at the bottom of
the form so everyone can initial that they saw it.

fredg said:
Help! I am trying to create a drop-down list from which a user can make more
two or more selections, both which will appear in the "response box." For
example, I want to create a box that askes the user to "Choose ALL that
apply." The user then has the option of highlighting two or more items in the
drop-down list by holding down the "Control" or "Shift" key. Once the user
has made his/her selections, and hits "Enter," the selections appear in the
response/answer box.

Any assistance will be appreciated.

A Drop-down list?
A control that drops down is a combo box.
A combo box is limited to 1 selection.

You can use a List box control (which does not drop down).
Set it's MultiSelect property to either Simple or Extended.

You then need code to extract the selected items.

Dim varItem as Variant
Dim strResult as String
For Each varItem In ListBoxName.ItemsSelected
strResult = strResult & Me!ListBoxName.ItemData(varItem) & ", "
Next varItem
strResult = Left(strResult, Len(strResult) - 2)
[SomeControl] = strResult

This should result in a strResult variable that looks like:
Joe, Steve, Anne, Mary, John
 

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