Help with Search code Please(RESOLVED)
I want to display the results in a text box.
If I do a search by Title it will work, but searching
by Author it says it's not there ( same book)
VB Code:
Option Explicit
Private cn As ADODB.Connection
Private rs As ADODB.Recordset
Private Sub cmdSearch_Click()
If Trim(txtAuthor.Text) <> "" Then
'we have something in the text box
rs.Open "SELECT * FROM ACT WHERE AUTHOR Like '" & Trim(txtAuthor.Text) & "'", cn, adOpenKeyset, adLockBatchOptimistic, adCmdText
If rs.EOF Then
'nothing was returned
lblNo.Caption = "No"
Else
'We have one or more results
With rs
txtTitle.Text = .Fields("TITLE")
End With
End If
End If
rs.Close
End Sub
Can anyone see what I am doing wrong?
Thanks