Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get Listbox Selected Item
Message
General information
Forum:
Microsoft Office
Category:
Access
Title:
Get Listbox Selected Item
Miscellaneous
Thread ID:
01511370
Message ID:
01511370
Views:
72
How do you get the selected item from a listbox? I'm using Access 2007. So far I have this:
Private Sub lstGroups_AfterUpdate()

    Dim lngRow As Long
    Dim strMsg As String
    
    With Me.lstGroups
        
        For lngRow = 0 To .ListCount - 1
            If .Selected(lngRow) Then
                strMsg = strMsg & ", " & .Column(1, lngRow)
            End If
        Next lngRow
    
    End With
      
End Sub
But the IF statement is never true unless multiselect is on.

Thanks
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Reply
Map
View

Click here to load this message in the networking platform