Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Cascading Multiselect Listbox

Posted on 2016-09-20
3
Medium Priority
?
87 Views
Last Modified: 2016-10-06
I would like to create a listbox row source based on a selection in another listbox.Any examples for Ms Access
0
Comment
Question by:Svgmassive
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 19

Accepted Solution

by:
John Tsioumpris earned 2000 total points
ID: 41806330
A simplified code :
Dim ListItem as Variant
Dim intCount as Integer
 For intCount = ListBoxSOURCE.ListCount - 1 To 1 Step -1
    ListItem = ListBoxSOURCE.ItemData(intCount )
   ListBoxDestination.AddItem ListItem
Next

Open in new window

0
 
LVL 39

Expert Comment

by:PatHartman
ID: 41806976
In this regard, listboxes work the same way that combos work.  In the dependent listbox's RowSource include selection criteria that references the controlling listbox.

Select ... From ... Where thePK = Forms!myform!lstMajor

Then in the AfterUpdate event of lstMajor, requery the dependent listbox

me.lstDependent.Requery

Or, if you prefer, you can use any other "cascading combos" solution.
0
 
LVL 4

Expert Comment

by:bfuchs
ID: 41809723
Actually depends if you need to have more then one value selected, if yes then set the list box multi select property to either simple or extended and use John's suggestion otherwise set muti select to none and use it the way Pat has suggested.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question