Listbox Selected Property = -1

  • Thread starter Thread starter Seth
  • Start date Start date
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.
 
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
 
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.
 
Back
Top