I am trying to build a search form that loops through my data, searching for what would be a wide variety of criteria. I want to include "AND/OR" operators but I cannot discern a logical way of approaching this. Here is what the search box would look like, but how would I go about looping through each line to search my data by the given criteria?
Criteria to loop through:
Firstname = John
or
Firstname = Paul
and
Lastname = Smith
So, basically I would like to loop through my data and find anyone named John Smith or Paul Smith.
Here is some futile attempt at doing this:
Also, the "=" operator is subject to change. It could be something like this as well:Code:For Each strLine As String In TextBox2.Text.Split(vbNewLine) Dim SearchFor As String = strLine.ToString If SearchFor = vbLf & "AND" Or SearchFor = vbLf & "OR" Then End If For Each dr As DataRow MyDataTable.Rows If MyDataTable.Rows(RowNumber)(ColumnName) = ItemToFind Then End If Next Next
RecordNumber > 1000
And
RecordNumber < 2000




Reply With Quote
