Hello All, I am having a problem using a search function within a dataview. My sample data was 3 names then 5.

First set was:
A smith
b smith
c smith

then i added:
d smith
e smith

(I was Searching by last name criteria)
I discoverd that my searching was taking me to the middle record of the search instead of the first record??
on my first test i was going to Record "B smith" as my starting record in my form for the search then when i added the other two then "C smith" became my starting record from my search. I am unsure what is occurring and any insight would be apreciated.

below is included my actual code...

VB Code:
  1. Dim objDataView As DataView    
  2. //
  3. *
  4. *
  5. *
  6. *
  7. //
  8. Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click
  9.         Dim storeRecordPosition As Integer
  10.         selectCriteria()
  11.         storeRecordPosition = objDataView.Find(txtSearchCriteria.Text)
  12.  
  13.         If storeRecordPosition = -1 Then
  14.             StatusBar1.Text = "Record Not Found"
  15.         Else
  16.             StatusBar1.Text = "Record Found"
  17.             objCurrencyManager.Position = storeRecordPosition
  18.         End If
  19.     End Sub
  20.  
  21.  
  22.  
  23.  
  24.     Private Sub selectCriteria()
  25.         Select Case cboCriteria.SelectedIndex
  26.             Case 0 'First Name
  27.                 objDataView.Sort = "FirstName"
  28.             Case 1 'Last Name
  29.                 objDataView.Sort = "LastName"
  30.             Case 2 'State
  31.                 objDataView.Sort = "State"
  32.             Case 3 'Zip
  33.                 objDataView.Sort = "Zip"
  34.         End Select
  35.         StatusBar1.Text = "Sorted by " & cboCriteria.SelectedItem
  36.     End Sub