Connecting Tech Pros Worldwide Help | Site Map

Extended Selection Listbox

 
LinkBack Thread Tools Search this Thread
  #1  
Old December 28th, 2007, 08:05 PM
McSwain
Guest
 
Posts: n/a
Default Extended Selection Listbox

I'm having alot of trouble getting the selected rows from a listbox
set for Extended selection.

I've tried using ItemsSelected.Count but it doesn't seem to work
consistently. When I select a set of consecutive rows, it says the
Count is 1, but when I select using the Ctrl key, it shows the correct
Count.

Any ideas?
Thanks
Paul.

  #2  
Old December 29th, 2007, 01:15 AM
Allen Browne
Guest
 
Posts: n/a
Default Re: Extended Selection Listbox

Paul, what version of Access is this?
I can't reproduce the problem in Access 2007 SP1.

Presumably the list box is unbound (since it's multi-select.)
Is the Bound Column visible?
Column Heads on or off?

Are you using a particular event to test ItemsSelected.Count?

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"McSwain" <paul.d.mcswain@gmail.comwrote in message
news:5e58b55b-dfbd-483a-bc27-f2305b4c2bd5@f3g2000hsg.googlegroups.com...
Quote:
I'm having alot of trouble getting the selected rows from a listbox
set for Extended selection.
>
I've tried using ItemsSelected.Count but it doesn't seem to work
consistently. When I select a set of consecutive rows, it says the
Count is 1, but when I select using the Ctrl key, it shows the correct
Count.
>
Any ideas?
Thanks
Paul.
  #3  
Old December 29th, 2007, 01:55 AM
Salad
Guest
 
Posts: n/a
Default Re: Extended Selection Listbox

McSwain wrote:
Quote:
I'm having alot of trouble getting the selected rows from a listbox
set for Extended selection.
>
I've tried using ItemsSelected.Count but it doesn't seem to work
consistently. When I select a set of consecutive rows, it says the
Count is 1, but when I select using the Ctrl key, it shows the correct
Count.
>
Any ideas?
Thanks
Paul.
Since you don't provide any code it would be difficult to determine what
you are doing wrong.

Adding to Allen's post, what happens if you were to run this code
MsgBox Me.YourListBoxName.ItemsSelected.Count
in the LostFocus event.

What happens if you were to run this code?
Dim var As Variant

If Me.YourListBoxName.ItemsSelected.Count 0 Then
For Each var In Me.YourListBoxName.ItemsSelected
msgbox Me.YourListBoxName.Column(0, var) & ", "
Next
Else
msgbox "Nothing is selected!"
Endif

Brain
http://youtube.com/watch?v=EiuuiTwqBLE
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.