Results 1 to 7 of 7
  1. #1
    Ellpee is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    May 2013
    Posts
    80

    MultiSelect List Box/Filter?

    Hi All. Have a situation where a multiselect list box shows (depending on user's previous choices) all accounts that currently hold a particular stock, or all active accounts, full stop. For a new stock market trade transaction, I want the user to be able to select only the few accounts, likely less than 10, that are relevant to the current transaction.



    Thing is, in either case the initial number of items in the list box would be LARGE -- over 100 at best if limited by holdings, conceivably several hundred if not. So, now comes my question. After the user has made the necessary picks, can I do something with code (launched by a button, probably) that would "adjust" what is displayed in the listbox to only selected items, so user can see he/she has indeed selected all the relevant accounts and only those? Looked at properties for the listbox but didn't find a filter property that would work beyond what I could have done with the RowSource property in the first place (at which point I unfortunately had no idea what listed items the user would select). Could I maybe change the SELECT statement using SelectedItems as a criterion, then refresh the listbox?

    Help me think through this, please. Until the user makes his/her choices, can see no way to limit the listbox population below those inconveniently large numbers. And I can't think of any way to make those choices without having to weed through big numbers of possible items.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Could but then user could not select additional items if they realized they missed something without modifying RowSource again to provide complete list.

    Should probably show users picks in another control, perhaps another listbox.

    Where are these selections saved to?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,250
    The typical design for this involves two side by side list boxes (Available and Selected) with four command buttons in between (Select, Select All, Unselect and Unselect All) usually with arrows instead of captions showing the direction the selection(s) are going. There are many examples on the web for this, I prefer using some sort of a check box (IsSelected) in the source table and simply requery the two list boxes after the user pushes a button. The trick is to ensure the table is isolated from other users so I use a local front-end table for that.

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  4. #4
    Micron is online now Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    Suggestion is a common approach. User selects one or more list items from initial listbox, clicks a button to transfer those selected, then some action uses the selected items list.
    It's also 'customary' to have buttons to Take All (one button for each direction you want to transfer). It might look something like this

    Click image for larger version. 

Name:	1DeptsXfer.jpg 
Views:	29 
Size:	38.6 KB 
ID:	47538
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,879
    Here's an example custom class picklist.
    Attached Files Attached Files
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  6. #6
    Ellpee is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    May 2013
    Posts
    80
    Hmm, useful thoughts. Side-by-Side seems the most reasonable for my situation, though I'll look closer at the ccPickList idea as soon as I have time. For further info, at this juncture list is not stored anywhere; plan is, when selects are "validated," store them in a (CSV) global string variable as they are used at several points later in the procedure via the In() functionality. Thanks to all for inputs so far.

  7. #7
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,879
    For further info, at this juncture list is not stored anywhere; plan is, when selects are "validated," store them in a (CSV) global string variable as they are used at several points later in the procedure via the In() functionality.
    My picklist returns a csv with several options for formatting so it works well when using it with an IN clause.

    I made a few small changes and I can no longer edit the above post, so i'm attaching another copy.
    Attached Files Attached Files
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 14
    Last Post: 09-03-2020, 06:26 AM
  2. Replies: 1
    Last Post: 01-28-2013, 10:55 PM
  3. Replies: 1
    Last Post: 11-23-2012, 10:26 PM
  4. HELP! using list boxes with multiselect
    By tarhim47 in forum Forms
    Replies: 21
    Last Post: 11-08-2010, 02:51 PM
  5. Forms + Multiselect list boxes
    By tarhim47 in forum Forms
    Replies: 0
    Last Post: 11-08-2010, 10:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums