Consulting

Results 1 to 3 of 3

Thread: Access Listbox help

  1. #1
    VBAX Regular
    Joined
    Mar 2005
    Posts
    67
    Location

    Access Listbox help

    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

  2. #2
    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?

  3. #3
    BoardCoder VBAX Regular
    Joined
    May 2004
    Location
    Istanbul, Turkiye
    Posts
    73
    Quote Originally Posted by ukemike
    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:

    [vba]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[/vba]

    My listbox name is List0 in this sample code.

    I hope it helps.
    Suat

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •