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
Printable View
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
The only way I've managed to do this is by using the following:
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).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]
Cheers Alex it works like a charm. Its so obvious as well......someties you can't see the wood for the trees !!!!
Paul