Can anyone tell me why the following code does not find what I am looking for in my database but brings me to the last row in the table??
Thanks in advance!!
Private Sub btnfind_agent_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnfind_agent.Click
Dim fileasname, inttempfileasname = InputBox("What agent do you want to find", "Find")Me.BindingContext(dtagency).Position = 0
For inttemp = 1 To dtagency.Rows.Count - 1
If dtagency.Rows(inttemp).Item("file_as_name") = fileasname Then
Exit For
Else
Me.BindingContext(dtagency).Position += 1
End If
Next
End Sub
Thanks in advance!!
Private Sub btnfind_agent_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnfind_agent.Click
Dim fileasname, inttempfileasname = InputBox("What agent do you want to find", "Find")Me.BindingContext(dtagency).Position = 0
For inttemp = 1 To dtagency.Rows.Count - 1
If dtagency.Rows(inttemp).Item("file_as_name") = fileasname Then
Exit For
Else
Me.BindingContext(dtagency).Position += 1
End If
Next
End Sub