How do I make multiple Listbox selection in Access Form work?
February 13, 2007 4:08 PM   Subscribe

How do I make multiple Listbox selection in Access Form work?

I have created a form in MS Access Form module. It contains a master form (from table a) with a subform (from table b). The two forms are linked through a common key. The master form lists customer ID's from table a. When I select a customer ID in form a, form b will populate all orders placed by this customer. So far, everything works beautifully. My next goal is to allow the users to select multiple customers in form a, and show all orders placed by them. To accomplish that, I set the input value from form a "Yes" (actually "simple" or "extended") to allow multiple selection. Now I can highlight and select multiple ID's in the master form; however, there is no response from the subform. It seems the link is dead all of sudden. Do I need to write code to set Selected in the source form each time I make a selection? How do I do that? Please help.
posted by dy to Computers & Internet (1 answer total) 1 user marked this as a favorite
 
Here is a working example of using a listbox for multiple data selection, that handles most common errors that can be thrown, as well. You basically need to build a criteria query using a FOR loop, as the code example included shows. Getting the data returned to show up in your sub-form would seem to be a matter of nesting the criteria query in your sub-form, so that it "looks up" to your main form for criteria.
posted by paulsc at 2:38 AM on February 22, 2007


« Older No more dried up tatts!   |   Have I mis-identified my dog's breed? Newer »
This thread is closed to new comments.