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,