|
-
Mar 17th, 2003, 11:11 AM
#1
Thread Starter
New Member
Select All In ListBox
Does anyone know of a way to select all the items in a List Box ? I know you can do this in VB but the listbox in Access (XP) does not seem to support this.
Cheers
Paul
-
Mar 18th, 2003, 06:31 AM
#2
The only way I've managed to do this is by using the following:
VB Code:
[color="#0000A0"]Private[/color] [color="#0000A0"]Sub[/color] Command2_Click()
[color="#0000A0"]Dim[/color] intCounter [color="#0000A0"]As[/color] [color="#0000A0"]Integer[/color]
[color="#0000A0"]For[/color] intCounter = 1 [color="#0000A0"]To[/color] List0.ListCount
List0.Selected(intCounter) = [color="#0000A0"]True[/color]
[color="#0000A0"]Next[/color]
[color="#0000A0"]End[/color] [color="#0000A0"]Sub[/color]
You're meant to be able to set the multiselect property through code, but this doesn't work so you'll need to select this roperty of the listbox at design time to the last option (2).
-
Mar 18th, 2003, 07:09 AM
#3
Thread Starter
New Member
Cheers Alex it works like a charm. Its so obvious as well......someties you can't see the wood for the trees !!!!
Paul
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|