I am entering avalues into another text box and I want it to surrender Focus to another textbox if the value I have entered is the same as the one in the database.However what is happening is that if the value is the same as in the database the cursor just disappears and it does not give focus to the control that I want it to give focus to. Any ideas on how I can correct this.
Private
Sub
txtProducedAt_TextChanged(sender
As
System.
Object
, e
As
System.EventArgs)
Handles
txtProducedAt.TextChanged
Dim
iSql
As
String
=
"SELECT ID,SiteName FROM Sites WHERE SiteName = '"
& txtProducedAt.Text &
"' "
Dim
da
As
New
OleDbDataAdapter(iSql, LoginForm1.Conn)
Dim
dTable
As
DataTable =
New
DataTable
da.Fill(dTable)
If
dTable.Rows.Count = 0
Then
Exit
Sub
ElseIf
dTable.Rows.Count > 0
Then
txtProducedAt.Text = dTable.Rows(0)(
"SiteName"
).ToString
txtAccountNumber.Focus()
End
If
End
Sub