lorenzoaj,
That code snippet was just meant as an example. It probably won't answer your specific case. I still do not know what you intend to do with the selected values anyhow. The part of the code you quoted is intended to open a query. Is that your purpose?
That code can only help you to see how to get and manipulate multiple selected items from a listbox.
What is your knowledge of VB?
If you are a beginner, I may set up a small sample DB so you can study how the code works. A good method is to put breaking point in the code or execute it step by step and look at the content of the variables, + look at the help for each property/method to learn about it.
BTW, yes the code should go into a global module.
Alex