Unhighlight Listbox Items
I have a listbox that the user makes a selection from. Based on that selection I fill in some hidden text boxes to gather the necessary data I need to send to a query that inserts records into my database. After the query has run I update the row source of the listbox to display the remaining list items. (the item the user selected is now gone from the listbox.) After the above process is done I would like to be able to unhighlight any item in the listbox because my process is dependent on the user selecting an item from the box. If the next record in the listbox remains highlighted the user thinks that it is selected. I have tried using the .selected(listitem) = false solution but it does not appear to work. The research I have done says this is the way to go but I am wondering if by updating the row source of the listbox and then requerying is causing some problems. I have also tried to set the selected property of the list item to false before updating the row source to no avail. Here is a snapshot of the code, I appreciate any assistance on this.
intIndex = Me.lstAssistRequests.ListIndex
strSQLRowSource = "SELECT....."
Me.lstAssistRequests.RowSource = strSQLRowSource
Me.lstAssistRequests.Selected(intIndex ) = False ' this portion doesnt seem to work properly
The requery portion works perfectly, the item selected from the listbox is removed. The problem lies in after the item is removed the next item in the listbox is highlighted. I want it be unhighlighted so the user needs to explicity select the next item from the list box.