MajP
You've got your good things, and you've got mine.
- Local time
- Today, 06:01
- Joined
- May 21, 2018
- Messages
- 8,554
This one makes no sense to me. I am looping a multiselect listbox. Everything works fine except for the very first time after opening the form you click into the listbox. It was returning null in this line of code
val = (ctrl.Column(TheColumn, ctrl.ItemsSelected(I)))
However the arguments all return legit values. So the column property had proper inputs, but still returned NULL. After several different approaches I mistakenly left in some code where I called the same line of code a second time and it worked. Not sure how that is even possible. Anyone seen anything like this? Or how this is possible.
val = (ctrl.Column(TheColumn, ctrl.ItemsSelected(I)))
However the arguments all return legit values. So the column property had proper inputs, but still returned NULL. After several different approaches I mistakenly left in some code where I called the same line of code a second time and it worked. Not sure how that is even possible. Anyone seen anything like this? Or how this is possible.
Code:
For I = 0 To ctrl.ItemsSelected.Count - 1
val = (ctrl.Column(TheColumn, ctrl.ItemsSelected(I)))
If IsNull(val) Then
debug.print "Null" 'verify NULL
'call same code again and it returns proper value
val = (ctrl.Column(TheColumn, ctrl.ItemsSelected(I)))
End If
...other code
Next I