Dim strSearchstring as String
Dim strResult as String
Dim intRecordCount as Integer
Dim i as Integer
lstResult.Clear
strSearchstring = txtText
dtSearchSupport.RecordSet.MoveLast
dtSearchSupport.RecordSet.MoveFirst
intRecordCount = dtSearchSupport.RecordSet.RecordCount
strResult = dtSearchSupport.RecordSet.FindFirst ("Name='" & strSearchString & "'")
If dtSearchSupport.RecordSet.NoMatch Then
lstResult.AddItem "No posts were found"
Exit Sub
End If
Do Until i = intRecordCount
strResult = dtSearchSupport.RecordSet.FindNext ("Name='" & strSearchString & "'")
If dtSearchSupport.RecordSet.NoMatch Then
lstResult.AddItem "End of posts"
End If
lstResult.AddItem strResult
i = i + 1
Loop