Friends please help me... I have Three text boxes 1.Bank 2.Acno 3.Name I am selecting record from database where Bank and Acno are =(txtbank.text and txtacno.text) If any record found, the focus should go to the third textbox-'Name' else message "Record not found" should be displayed.I tried the following code but no success.
CN.Open()
SQL = "SELECT * from Receipts WHERE Bank='" & TxtBank.Text & "'" & "AND Acno='" & TxtAcno.Text & "'"
DA = New OleDb.OleDbDataAdapter(SQL, CN)
DA.Fill(DS, "Deposit")
If DS.Tables(0).Rows.Count = 0 Then
MsgBox("No Such Account")
Else
TxtName.Focus()
End If