Multi-select list box

  • Thread starter Thread starter Jim Pockmire
  • Start date Start date
If Me!MyListBox.ItemsSelected.Count = 0 Then
' Nothing's been selected
Else
' At least one item has been selected
End If
 
Jim said:
How can I test to see if no item has been selected in a multi-select list
box?


Try something like this:
Public Function TestList()
Dim varItem, blnFnd As Boolean
blnFnd = False
With List0
For Each varItem In .ItemsSelected
Debug.Print .Column(0, varItem)
blnFnd = True
Next varItem
End With
TestList = blnFnd
End Function

This will return False if no rows are selected

HTH,
Chris M.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top