I am populating a list box to select a document. In some instances there is
only one item in the listbox so I want to select that item automatically for
the user.
The question is how do I select the only item in the listbox
Me.lstDocuments.Selected(0) = True (or is it 1? - neither work!)
Thanks
Stephen
Sorry, helps if you run the additem code first!
Me.lstDocuments.Selected(0) = True
is correct
> I am populating a list box to select a document. In some instances there is
> only one item in the listbox so I want to select that item automatically for
[quoted text clipped - 4 lines]
> Thanks
> Stephen
Karl E. Peterson - 19 Oct 2007 22:59 GMT
How about setting the ListIndex property?

Signature
.NET: It's About Trust!
http://vfred.mvps.org
> Sorry, helps if you run the additem code first!
> Me.lstDocuments.Selected(0) = True
[quoted text clipped - 8 lines]
>> Thanks
>> Stephen