Listbox Selected Property = -1

S

Seth

I'm programmatically creating the rowsource string for a
Value List type Listbox. When I interrogate the control,
the listcount is 1 and all the columns have data. I set
listbox.Selected(0) = True, but ?listbox.Selected(0)
returns -1. Can anyone tell me why this happens?

Thanks.
 
S

Seth

What's the emoticon for embarrassment?

I neglected to include the real issue in my original
post, which is why the value property of the listbox is
null when the selected row has a value in the bound
column. i.e.:

?listbox
null
?listbox.selected(0) = True
True
?listbox.boundcolumn
1
?listbox.column(0)
232
 
D

Dirk Goldgar

Seth said:
What's the emoticon for embarrassment?

I neglected to include the real issue in my original
post, which is why the value property of the listbox is
null when the selected row has a value in the bound
column. i.e.:

?listbox
null
?listbox.selected(0) = True
True
?listbox.boundcolumn
1
?listbox.column(0)
232

Is the list box set for multiselect (simple or extended), by any chance?
For multiselect list boxes the Value property is always Null.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top