By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,635 Members | 911 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,635 IT Pros & Developers. It's quick & easy.

Extended Selection Listbox

P: n/a
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.
Dec 28 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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" <pa************@gmail.comwrote in message
news:5e**********************************@f3g2000h sg.googlegroups.com...
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.
Dec 29 '07 #2

P: n/a
McSwain wrote:
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
Dec 29 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.