List Box Count

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have made a "list" box so that there are only about 4 or 5 options that you can choose from in the box. I was wondering if there was a way to count how many of each are being selected... Kinda like you would do with a yes/no field sum. Any advice would be appreciated.
 
Something like so???

Private Sub cmdCountRecords_Click()
Dim NumberOfItems As Integer

NumberOfItems = Me.lstMyListBox.ItemsSelected.Count

MsgBox "You selected " & NumberOfItems _
& " record(s) from the list box.", vbInformation, _
"Number Of Records"

End Sub
 
Back
Top