PDA

View Full Version : Multi-select listbox form to run reports



wfishero
11-19-2014, 08:11 AM
I need to build a Listbox in the Form view in Access 2010 that will allow me to select multiple names to run a report with. I currently have one built that will allow me to select one name at a time (Combo box) and successfully run reports. However, now I need to select more than one. Ideally, I would like to be able to open the Form, select all of the names I need, click OK, and get a Report. Any ideas/help???!?! FYI - I'm code-writing challenged!

Thanks,
Wes

jonh
11-19-2014, 10:00 AM
Set the multiselct property to simple or extended.
Then use code to get the list of selected items.


For Each itm In List0.ItemsSelected
Debug.Print itm, List0.ItemData(itm)
Next

But how you feed those choices to the report depends on the report.

wfishero
11-19-2014, 01:43 PM
Set the multiselct property to simple or extended.
Then use code to get the list of selected items.


For Each itm In List0.ItemsSelected
Debug.Print itm, List0.ItemData(itm)
Next

But how you feed those choices to the report depends on the report.


This did not work. I selected the Simple option for Multi-select. But the code was giving me an error.

jonh
11-19-2014, 01:58 PM
Well, thanks for letting us know.