View Full Version : Searching List Boxes


Hunter
04-30-2001, 10:15 AM
I am wondering if there is a way to search the contents of a list box just as you'd search any field? Ideally, I'd like to use the standard MS Office "Find" window (<CRTL>-F).

Thanks in advance...

AccessUser
05-02-2001, 09:37 AM
You can cycle through all the items in a list box.
dim strSearchFor As String

strSearchFor = "Search Criteria"

For varItm = 0 To Me.ListBox.ListCount - 1
If Me.ListBox.Column(1, varItm) = strSearchFor Then
'do what you want
Exit For
End If
Next varItm

I'm not sure if you could use the standard MS Office "Find" window to input the search criteria or not.