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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Limit selected items in list box?

Status
Not open for further replies.

mesavage

Programmer
Jan 24, 2002
21
0
0
US
Is there a way that once the user has selected a certain maximum for the list box, to disallow them to select anymore? I would like to limit my user to be able to select a maximum of 10 items, with multi-select set to extended. Any help is greatly appreciated, thanks!

Miriam
 
if ListBox_Name.ListCount > 10 then
msgbox ("I'm sorry, you selected more then 10 items in my big box! You may only select 10 or less!")
else
'all your processing that was triggered by pressing the
'command button.
end if

hope this helps you...
--James
junior1544@jmjpc.net
Life is change. To deny change is to deny life.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top