"RBohannon" <ra*****@hotmail.com> wrote in
news:11**********************@g47g2000cwa.googlegr oups.com:
I have a multi-selectable listbox named lstTitles.
In the OnClick event I had the following:
If Not IsNull(Me.lstTitles) Then
' do something with list selection
Else
' do something else
End If
This worked when I wrote it and has continued to work
since...until today.
Now when I click on the listbox, it's Value is Null. The
ListIndex property is set to the row that I clicked on, but
lstTitles.Value is always Null.
I worked around this using
If Me.lstTitles.ListIndex <> -1 Then
...
but I'm curious if anyone could tell me why the original code
would suddenly stop working.
What's your rowsource?
Perhaps you've changed the bound column and that column has no data
in it.
Actually, just noticing that you said "multiselect," I believe
multiselect listboxes are *always* Null, no matter whether there is
a selection or not.
How could you meaningfully return a single value from a listbox with
more than one item selected?
You have to process the .ItemsSelected collection to figure out what
the selected values are. To see if it's not got anything selected,
just check the .Count of .ItemsSelected.
--
David W. Fenton
http://www.bway.net/~dfenton
dfenton at bway dot net
http://www.bway.net/~dfassoc