PDA

View Full Version : Access Listbox help



ukemike
03-23-2005, 09:11 AM
Hi everyone.

I am stuck on a problem im having. Basically i load up a list with items from a recordset. The listbox's Row Source Type is Value List.
I cant find anywhere how to get the list from the listbox.
I found how to get selected items from the listbox, but I need the whole thing, dont matter whether it is selected or not.

Thank you
Mike

Groundhog
03-23-2005, 08:28 PM
Hi Mike -

I'm not to sure what your question is. Are you having problems seeing the entire list in the list box or are you trying to allow the user to select multiple items?

smozgur
03-26-2005, 11:21 AM
Hi everyone.

I am stuck on a problem im having. Basically i load up a list with items from a recordset. The listbox's Row Source Type is Value List.
I cant find anywhere how to get the list from the listbox.
I found how to get selected items from the listbox, but I need the whole thing, dont matter whether it is selected or not.

Thank you
Mike

Hi Mike,

Use following code in a sub:

Dim i As Long
For i = 0 To Me.List0.ListCount - 1
If MsgBox("Item " & (i + 1) & ": " & Me.List0.Column(0, i) & _
vbCrLf & "Do you want to continue?", vbYesNo + vbQuestion, "List Items") = vbNo Then Exit Sub
Next i

My listbox name is List0 in this sample code.

I hope it helps.
Suat