Iterate over a Combobox

  • Thread starter Thread starter Xaradas
  • Start date Start date
X

Xaradas

Hi all,

I have a form with a comboxbox whose data are
prefilled using a query.
I wish to know ho to iterate over the item
of the combobox and for each item display
it's properties (index,value,...) using the msgbox istruction.

Thanks and sorry for my little english.
 
A combo box allows you to display a list and select a single item.

A list box allows you to display a list and select a single item or multiple
items.
The list box is what would be eligible for iteration since for multiple
selection you need to determine what was selected (or what was not
selected).

For example:

' List box that has 2 columns of data
For Each varIetm In Me.List0.ItemsSelected
strValue1 = Me.lstVisitDates.Column(0, varItem)
strValue2 = Me.lstVisitDates.Column(1, varItem)
Next varIetm

HTH

--
Rob

FMS Professional Solutions Group
http://www.fmsinc.com/consulting

Software Tools for .NET, SQL Server, Visual Basic & Access
http://www.fmsinc.com

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 
Back
Top