Results 1 to 5 of 5
  1. #1
    Torinjr is offline Advanced Beginner
    Windows 7 32bit Access 2013
    Join Date
    May 2015
    Posts
    53

    Cascaded Multi Select List Box - Query code?

    Hi All, I have a Form that I want to have a cascading multi select list box. As shown below:



    Click image for larger version. 

Name:	Capture.PNG 
Views:	16 
Size:	31.6 KB 
ID:	21128

    I am having trouble writing a query that updates the second list box "sub contractors" based on the multiple selections from the first list box. I have been able to set up cascaded comboboxes in the past but have never tried with a list box. Can anyone guide me through this please?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Never seen this with a multi-select listbox. These are UNBOUND controls?

    I think the second listbox will need code that loops through the first listbox and builds filter parameters that can be used with IN operator. Review: http://allenbrowne.com/ser-50.html
    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
    Torinjr is offline Advanced Beginner
    Windows 7 32bit Access 2013
    Join Date
    May 2015
    Posts
    53
    Yes they are UNBOUND. So this seems reasonably difficult to do, for me anyway. Is there another way that I can get the user to select multiple Sub Contractors based on the multiple Scope/Package selected? This was just the first way that came to mind...

    Thanks.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    If you want to restrict the second listbox RowSource based on selections in first, VBA is only method I know of.

    I don't know your data structure, but a single listbox might be able to have a RowSource that has all valid combinations of package/contractors as choices.
    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.

  5. #5
    Torinjr is offline Advanced Beginner
    Windows 7 32bit Access 2013
    Join Date
    May 2015
    Posts
    53
    Yea i think i might just create a single list box to display 2 columns. It will be a longer list but is okay for the amount of data i have at the moment.

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

Similar Threads

  1. Replies: 3
    Last Post: 04-08-2014, 01:02 PM
  2. Multi select list box and DELETE query
    By thart21 in forum Programming
    Replies: 1
    Last Post: 01-08-2012, 08:47 PM
  3. Replies: 11
    Last Post: 09-22-2011, 01:13 PM
  4. Multi-Select List Box as Criteria in Query
    By broadwat in forum Queries
    Replies: 6
    Last Post: 09-19-2011, 07:47 AM
  5. Replies: 1
    Last Post: 01-28-2011, 07:59 PM

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