btnFind

Seabass

New member
Joined
Oct 20, 2004
Messages
1
Programming Experience
Beginner
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
 

Mercurio2004

Member
Joined
Aug 31, 2004
Messages
9
Programming Experience
Beginner
Hi

try put all in uppercase or lowercae. Take a look to the spaces at then end of the field (try TRIM).
If the field exists in the database, is something like this...
 

Mercurio2004

Member
Joined
Aug 31, 2004
Messages
9
Programming Experience
Beginner
Hi

try put all in uppercase or lowercae. Take a look to the spaces at then end of the field (try TRIM).
If the field exists in the database, is something like that...
 
Top Bottom