Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / October 2007

Tip: Looking for answers? Try searching our database.

Setting a value in a list box

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Stephen English - 18 Oct 2007 07:12 GMT
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
Stephen English - 18 Oct 2007 07:15 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.