You must use the ItemsSelected collection of the listbox. From Access help:
Dim frm As Form, ctl As Control
Dim varItm As Variant, intI As Integer
Set frm = Forms!Contacts
Set ctl = frm!Names
For Each varItm In ctl.ItemsSelected
For intI = 0 To ctl.ColumnCount - 1
Debug.Print ctl.Column(intI, varItm)
Ok, I think I need to expand my question if I may..
Basically my form is for booking group visits. One group can make many visits.
A group visit can also have named Users making the visit (many groups can have many Users), so I have a link table called tblLinkedUsers sitting between tblusers and tblvisits to allow for the many-to-many relationship.
So on my form I select from two listboxes - a Lstgroup (from tblGroups), and lstUsers (from tblUsers). Then, when the command button is pressed another form called frmVisits opens which displays the selected visit details which are now stored in tblVisits. Each row in tblVisits has its primary key of visitID set to an autonumber.
I then have a subform within frmVisits called subfrmLinkedUsers which displays the selected User(s) for that visit – again linked by the visitID fields
And it is this User(s) part which I need to be able to work out – I need to select at least one or more Users at a time from lstUsers listbox (set to multiselect) on the first form, press the command button to open the second form and have the visit details displayed in a listbox (this part I can do already), and then in the subform (subfrmLinkedUsers)display the User(s) who are part of the group visit.
It is the last part of adding multiple records into tblLinkedUsers (along with the VisitID) which I need to work out.
So I am unsure how to adjust the code suggested in this thread to do add the autonumber from the visit aswell as the UserId's.