Hi all
In continuation of this thread, I am looking to have similar function where I can select multiple values and delete them at once, rather than deleting each value individually. My listbox is bound to a table, and as such row source type is set to table/query. Here is my code:
The problem I am having with this solution, and others I have tried is with the line
ListCourse.RemoveItem aryValues(i). I get runtime error 6014: The RowSourceType property must be set to 'Value List' to use this method. I cannot have the rowsourcetype property as value list since the list will most likely see quite a few changes.
Any workaround suggestions will be appreciated, as always
In continuation of this thread, I am looking to have similar function where I can select multiple values and delete them at once, rather than deleting each value individually. My listbox is bound to a table, and as such row source type is set to table/query. Here is my code:
Code:
Dim i As Integer
Dim intCount As Integer
Dim aryValues() As Variant
For i = 0 To ListCourse.ListCount - 1
If ListCourse.Selected(i) Then
ReDim Preserve aryValues(intCount)
aryValues(intCount) = i
intCount = intCount + 1
End If
Next i
For i = UBound(aryValues) To 0 Step -1
ListCourse.RemoveItem aryValues(i)
Next i
The problem I am having with this solution, and others I have tried is with the line
ListCourse.RemoveItem aryValues(i). I get runtime error 6014: The RowSourceType property must be set to 'Value List' to use this method. I cannot have the rowsourcetype property as value list since the list will most likely see quite a few changes.
Any workaround suggestions will be appreciated, as always
