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

Select All items in a listbox 1

Status
Not open for further replies.

tekvb1977

Technical User
Nov 16, 2005
46
US
How could I select all items in a list box automatically by using the "Select All" command button.

Thanks in advance

J

 
Is there a select all button?

I think you'll need some code, but since listbox controls are really forms stuff, forum702 is probabley the more correct forum.

Anyway, somthing like this perhaps?
[tt]
dim lngCount as long
dim lst as listbox

set lst = me.controls("lstNameOfYourListBoxControl")
for lngCount = 0 to lst.listcount - 1
lst.selected(lngCount) = true
next lngCount
set lst = nothing[/tt]

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top