Multiple List Boxes

J

Joanne

Hello,
I have three list boxes. The first one has a list of colleges, the second a
list of degrees and the third a list of honors like cum laude etc. I am
trying to use a For Loop to discover whether or not an entry in the college
list box has been selected and then, if it has, to take the information from
the degree list and the honors list. Each list has a different number of
entries and I'm not quite sure how to approach this. Thank you in advance
for any help you can provide.
 
J

Jonathan West

Joanne said:
Hello,
I have three list boxes. The first one has a list of colleges, the second
a
list of degrees and the third a list of honors like cum laude etc. I am
trying to use a For Loop to discover whether or not an entry in the
college
list box has been selected and then, if it has, to take the information
from
the degree list and the honors list. Each list has a different number of
entries and I'm not quite sure how to approach this. Thank you in advance
for any help you can provide.

Hi Joanne,

If you are only permitting a single college to be selected (i.e. the
AllowMultiSelect property of the listbox is False), then if no selection has
been made, the ListIndex property of that listbox is -1. If a selection has
been made, the Listindex property is in the range 0 to number of items - 1.

If you are permitting multiple selections in the listbox (i.e.
AllowMultiSelect is True), then you need to check the Selected property of
every item in the listbox. if one or more items is True, then you have at
least ine selection.

There are code examples for these properties in the VBA help.


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 

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