Results 1 to 2 of 2

Thread: List Box multiselect

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2000
    Location
    Sudbury, Ontario, Canada
    Posts
    274

    Question

    I have a multiselect listbox that's populated with words and each word is assigned a number through the itemdata property like this:

    strSql = "SELECT * FROM Vocational ORDER BY vocdesc"

    Set rstTemp = fCnn1.Execute(strSql)

    Do While Not rstTemp.EOF
    lstVocational.AddItem rstTemp!vocdesc
    lstVocational.ItemData(lstVocational.NewIndex) = rstTemp!vocid

    rstTemp.MoveNext
    Loop



    What I want to do is select certain indexes in the listbox based on the itemdata property without loooping through the listbox. Is that possible?

    I know this is wrong but Something like this:

    strSql = "SELECT internalvoc.vocid FROM internalvoc "
    strSql = strSql & "WHERE referralid = " & strReferralID

    Set rstTemp = fCnn1.Execute(strSql)

    Do While Not rstTemp.EOF

    'THIS IS WHAT I WANT TO CHANGE
    lstVocational.Selected(lstVocational.ItemData(rstTemp!vocid)) = True

    rstTemp.MoveNext
    Loop

    Thanks in advance,


  2. #2

    Question

    Sorry your question is not clear.

Posting Permissions

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



Click Here to Expand Forum to Full Width