A
alex
Using Access ‘03
I have a multiselect listbox that transfers values from one listbox to
another (a paired listbox situation left-to-right).
I just finished the code to transfer selected values from one listbox
to another and noticed that I need to clear the values from the source
listbox; i.e., others are now highlighted.
I’ve spent the last few hours using recommended snippets of code to do
just that, but none are consistently working.
Every piece of code that I’ve used works a few times, but when I
select many non-contiguous values (or even many values), I’m left with
black lines where the value used to be. Sometimes it’s one line,
other times it’s blocks of black lines. These black lines are more
than an aesthetic pain; I’m actually getting null values transferred
to my destination table!
Here’s an example of some of the code that I’ve tried; I’ve used
others:
Dim varitm As Variant
'
With Me.lbSource
For Each varitm In .ItemsSelected
.Selected(varitm) = False
Next varitm
End With
‘Or
Dim intI As Integer
With Me.lstMyListBox
For intI = (.ItemsSelected.Count - 1) To 0 Step -1
.Selected(.ItemsSelected(intI)) = False
Next intI
End With
Has anyone experienced this problem?
alex
I have a multiselect listbox that transfers values from one listbox to
another (a paired listbox situation left-to-right).
I just finished the code to transfer selected values from one listbox
to another and noticed that I need to clear the values from the source
listbox; i.e., others are now highlighted.
I’ve spent the last few hours using recommended snippets of code to do
just that, but none are consistently working.
Every piece of code that I’ve used works a few times, but when I
select many non-contiguous values (or even many values), I’m left with
black lines where the value used to be. Sometimes it’s one line,
other times it’s blocks of black lines. These black lines are more
than an aesthetic pain; I’m actually getting null values transferred
to my destination table!
Here’s an example of some of the code that I’ve tried; I’ve used
others:
Dim varitm As Variant
'
With Me.lbSource
For Each varitm In .ItemsSelected
.Selected(varitm) = False
Next varitm
End With
‘Or
Dim intI As Integer
With Me.lstMyListBox
For intI = (.ItemsSelected.Count - 1) To 0 Step -1
.Selected(.ItemsSelected(intI)) = False
Next intI
End With
Has anyone experienced this problem?
alex