Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Value of a Listbox

Status
Not open for further replies.

Jengo

Programmer
Apr 17, 2000
100
US
How do you get the value of a list box and or determine if nothing is selected in the listbox?
 
Dim X as Variant<br>X = me!List1<br>If X = &quot;&quot; then<br>'nothing selected<br>end if<br> <p>DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you be more productive.
 
Try the ItemsSelected - property:<br><br>If Me!lstLevel.ItemsSelected.Count = 0 Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;Msgbox &quot;Nothing selected in List!&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;<br>End If<br><br>With ItemsSelected you can determine exactly how many items from a list are selected.<br><br><br>Greetings,<br><br>Dirk<br><br><A HREF="mailto:dirk.news@yucom.be">dirk.news@yucom.be</A>
 
PS: look also for ItemData in Help to retrieve the data from the list<br><br>Greetings,<br><br>Dirk<br><br><A HREF="mailto:dirk.news@yucom.be">dirk.news@yucom.be</A>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top