Scroll To Selected Item On Multiselect Listbox, Access 2003

a_ud

Registered User.
Local time
Today, 12:17
Joined
Mar 5, 2011
Messages
16
spacer.gif

Help appreciated here!! I've got a form with a multiselect listbox (extended) that holds a very long list of items (~90,000):

1 | Apple
2 | Orange
3 | Banana
...............
35313| Corn cob
...............


The user can select multiple items (non-sequential) on the listbox, say items 1 and 35313. I'd like the listbox to scroll (meaning display) to the currrently selected item, so that the user can see it while being processed.

I've seen stuff about property ListIndex, which does exactly that, but it's only useful when you have just ONE item selected (in a multiselect listbox apparently it deselects the rest of the items, so no point in using it, I guess, unless there's more to it!!).

So the key here is how to do the scrolling/display.

The code to loop through the listbox and process each selected item is attached:
Code:
Dim vItem As Variant
   Dim Content as String
   
   For Each vItem In Me.lst.ItemsSelected
   
       'scroll to selected item ???
       'processing of the selected item
       Content = Me.lst.Column(1, vItem)  'copy the content to do sth with it
       
       Me.lst.Selected(vItem) = False       'unselect the current item
          
   Next vItem      'go to next selected item

Any ideas on how to scroll to the currently selected item? Mind that I need to go through the list of selected items to process them for further use (i.e, I need them selected).

Thanks in advance, a.
 
Not Sure if I completely follow you, but could you not do something like this?

attachment.php


Have another ListBox and populate it, then use that listbox to get what you want?
 

Attachments

  • multiSelect.png
    multiSelect.png
    7 KB · Views: 2,856
I guess I could, but there is an issue with size. The listbox is extremely long (90K items) and also has sth like 6 columns, so most of the screen is already busy.

I'll use that if I don't have any other option.
 
So could you create Filters and populate so you could minimize the overload of the problem you are facing? Maybe classify them as Tropical Fruits, Exotic Fruits, Berries, etc and base don the Choice go one step deeper?

Sorry if this is not helping you at all. But this might be a path to a simplified solution.
 
No, there is no classification, my example is just an ilustration to make it clearer but there are no such clear groups.
I'd like to know whether Listindex has more properties that I think it has, it's quite a 'niche' command in Access 2003.
 

Users who are viewing this thread

Back
Top Bottom