Results 1 to 4 of 4

Thread: Listboxes

  1. #1
    Join Date
    Aug 2002
    Location
    Cambridge, England
    Posts
    47

    Unanswered: Listboxes

    Hi

    I have a listbox (no multiselect) and I want to be able to get the value of the bound column of the selected row. I have been having to use the follwoing code but surely you can do it in one line?
    Code:
    For Each i In Me.lstInvoiceDetails.ItemsSelected
        iJobID = Me.lstInvoiceDetails.ItemData(i)
    Next i
    Also, how do you get the value of column x the selected row, I have tried alllsorts with 'itemdata' and 'column' but cant seem to get it right.

    Thanks

    nstawardx

  2. #2
    Join Date
    Sep 2003
    Location
    Washington
    Posts
    8
    Just use a sSQL statement to grab what you need and insert it where you need.. Then just requery the control..

    me.lstinvoicedetails.itemselected.column(2)

    .column(ColumnNumber)

  3. #3
    Join Date
    Sep 2003
    Location
    T.O.
    Posts
    326

    Listboxes

    I usually use:
    Me.YourListBox.ItemData(Me.YourListBox.ListIndex)
    All code ADO/ADOX unless otherwise specified.
    Mike.

  4. #4
    Join Date
    Sep 2003
    Location
    Washington
    Posts
    8
    Originally posted by cykopat
    Just use a sSQL statement to grab what you need and insert it where you need.. Then just requery the control..

    me.lstinvoicedetails.itemselected.column(2)

    .column(ColumnNumber)

    Actually it should be

    " & listinvoicedetails.column(x) & "

    in Ssql.. Now that I think about it..

Posting Permissions

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