Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multi Select List Box

Status
Not open for further replies.

Tiggertoo

MIS
May 28, 2003
66
0
0
US
I'm trying to create a multi select list box... not sure whether I want extended or simple or what the difference is. I've tried both and I can see the available selections (divisions_ in the drop down. Using ctrl, click I select the multiple "divisions". When I close the form, the selections are not showing up in the table. That column is staying empty. I need all selections to show for each item in the table. What am I missing that these are not saving to my table? Also, am I going to have problems querying this field? Need to be able to generate a report showing just an individual "division" or all "divisions."

Make sense? I've done a search in Tek Tips but the responses I've found have not helped me at all.

I'm a beginning dummy... help!
 
Take a look at ItemsSelected in the VBA help file.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Sorry. That didn't help... this is all I can find in VBA

Private Sub List36_BeforeUpdate(Cancel As Integer)

End Sub

And since I don't speak VBA, I'm trying to fix by using the list box/properties... My list box shows the proper selections, I can <ctrl> click to select - but nothing shows up on the table.
 
When in VBE (Alt+F11) open the Immediate window (Ctrl+G), type ItemsSelected and then press the F1 key.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Okay, I found this but I don't know what to do with it... I'm sorry to be so absolutely stupid. If I just make by list box a regular box, the data is posted to my table. But I need the multi selection and that just isn't working.

Sub AllSelectedData()
Dim frm As Form, ctl As Control
Dim varItm As Variant, intI As Integer

Set frm = Forms!Contacts (assume this is my form name)
Set ctl = frm!Names (is this my divisions)
For Each varItm In ctl.ItemsSelected
For intI = 0 To ctl.ColumnCount - 1
Debug.Print ctl.Column(intI, varItm)
Next intI
Debug.Print
Next varItm
End Sub
 
Oh, well. Looks like no help here. Guess I need someone to hold my hand and walk me thru this. I get pointed in directions but when you don't know what you are looking at it is difficult to figure out what needs to be done and how to do it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top