VBA Capture Selected Items From Multi-Select List Box

GC2010

Registered User.
Local time
Today, 04:28
Joined
Jun 3, 2019
Messages
120
Hi - I have a form, with a multi-select list box, I am using this code to populate the list box
Code:
Private Sub Combo2_AfterUpdate()
Dim strSql As String
strSql = "SELECT ID, txtName, [CVN] & ' - ' & [SNV] AS FullInfo FROM AllData WHERE txtName  = """ & [Forms]![Form1]![Combo2] & """ ORDER BY txtName;"
'Debug.Print strSql
Me.List11.RowSource = strSql
End Sub

On a button press event, how can I capture what values were selected from the list box?
 
Hi. A listbox has a SelectedItems (or is it ItemsSelected?) collection that contains the selected items. You can loop through this collection to gather all the selected items.
 

Users who are viewing this thread

Back
Top Bottom