P
PeterM
I'm using AC2003. I have a multiselect listbox set to simple (List4). I
need to loop thru all selected items. The listbox has 2 columns in it.
Here's the code I have:
Dim tmpCTR as Long
Dim varItm As Variant
For Each varItm In Me.List4.ItemsSelected
tmpCTR = tmpCTR + 1
Next varItm
MsgBox tmpCTR
When I run it in debug, once it hits the For Each code, it goes directly to
the msgbox command and then displays 0 even when I have 4 items selected.
It's not even looping thru once.
I've looked thru this forum and found many examples pertaining to what I
need. As far as I can tell, my code should work. Does anyone have any idea
why it is not?
Thanks in advance for you time!
need to loop thru all selected items. The listbox has 2 columns in it.
Here's the code I have:
Dim tmpCTR as Long
Dim varItm As Variant
For Each varItm In Me.List4.ItemsSelected
tmpCTR = tmpCTR + 1
Next varItm
MsgBox tmpCTR
When I run it in debug, once it hits the For Each code, it goes directly to
the msgbox command and then displays 0 even when I have 4 items selected.
It's not even looping thru once.
I've looked thru this forum and found many examples pertaining to what I
need. As far as I can tell, my code should work. Does anyone have any idea
why it is not?
Thanks in advance for you time!