I've read through the FAQ guides here and I'm trying to figure out a solution to what seems like it should be a simple problem. The users are looking at a priority list of jobs stored in a listview. I'm using a listview instead of a listbox because I want to be able to format each row based on the status of the job (i.e. make jobs that need repair red, make jobs that are on hold yellow, etc). I've got the listview populated fine and I can format it no problem. The issue is, when the user alters the status of a job then I need to requery the row source -- as far as I know the only way to do that is to clear the listview and refill it. Again, I can get this to work no problem (though it's slower than I'd like) but now I've lost the row that was selected since I cleared and refilled the listview. I'm looking around for a way to set the selecteditem because I can store the value of the selected row before I clear the listview and then just set it, but I can't find a read property of the listview that I can set after I refill it to select the same row again.
This gives error "Object doesn't support this property or method"
I've also tried
which gives me a type mismatch
Suggestions? I'm hoping this is really easy and I'm just not used to listviews.
Code:
Public sub selectRow(mySelection as integer)
If myselection <> 0 Then 'something was selected and needs to be re-selected
[indent]Me.lsxPriorityList.SelectedItem (mySelection)[/indent]
End If
End Sub
This gives error "Object doesn't support this property or method"
I've also tried
Code:
Me.lsxPriorityList.SelectedItem = mySelection
which gives me a type mismatch
Suggestions? I'm hoping this is really easy and I'm just not used to listviews.