Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jul 2008
    Location
    Suffolk, United Kingdom
    Posts
    308
    Thanks
    0
    Thanked 0 Times in 0 Posts

    List box problem (2000/2003)

    Hi,

    I am using a list box to give users the choice of three optitions they can multi select if needed. I am then trying to get there choices so I can display them with the letter.

    The problem I have is getting all the options. The code below doesnt work as if counts the amount of selections (i.e. 2) then loops but adds the wrong choices to the str I no why it doesn't work but dont know how to correct it.

    Thanks

    i = Me.lstRefReason.ListIndex
    For i = 0 To i
    MDSQ2 = MDSQ2 & " " & Me.lstRefReason.List(i)
    Next i
    Regards
    Gerbil (AKA Kevin)

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: List box problem (2000/2003)

    Try

    Dim i As Integer
    For i = 0 To Me.ListBox1.ListCount - 1
    If Me.ListBox1.Selected(i) Then
    MDSQ2 = MDSQ2 & " " & Me.ListBox1.List(i)
    End If
    Next i

  3. #3
    3 Star Lounger
    Join Date
    Jul 2008
    Location
    Suffolk, United Kingdom
    Posts
    308
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: List box problem (2000/2003)

    As always PERFECT

    Thanks
    Regards
    Gerbil (AKA Kevin)

Posting Permissions

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