Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

List Boxes

Status
Not open for further replies.

MJCoxy

Programmer
Nov 22, 2001
16
0
0
US
I'm using a list box which holds a list of telephone numbers. I go down the list in turn from top to bottom using the 'selected' function. Firstly is there an easier way to do this i.e. MoveNext ?

The second thing, does anyone know how to display the selected number in a message box? It seems simple but I don't seem to be able to make it work.
 
I assume you have Multi-Select set to something other than None
Access allows you to use the ItemsSelected property of the listbox. If you want to see the data for each selected item:
Code:
   Dim varItem         As Variant
   For Each varItem In Me.List1.ItemsSelected
        Debug.Print Me.List1.ItemData(varItem)
   Next
Hope this helps!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top