Results 1 to 3 of 3

Thread: Help with Search code Please(RESOLVED)

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2004
    Location
    Tampa, Fl
    Posts
    39

    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:
    1. Option Explicit
    2. Private cn As ADODB.Connection
    3. Private rs As ADODB.Recordset
    4.  
    5. Private Sub cmdSearch_Click()
    6.  If Trim(txtAuthor.Text) <> "" Then
    7.   'we have something in the text box
    8.      rs.Open "SELECT * FROM ACT WHERE AUTHOR Like '" & Trim(txtAuthor.Text) & "'", cn, adOpenKeyset, adLockBatchOptimistic, adCmdText
    9.    If rs.EOF Then
    10.     'nothing was returned
    11.     lblNo.Caption = "No"
    12.    Else
    13.     'We have one or more results
    14.      With rs
    15.      txtTitle.Text = .Fields("TITLE")
    16.     End With
    17.   End If
    18. End If
    19. rs.Close
    20. End Sub

    Can anyone see what I am doing wrong?
    Thanks
    Last edited by mhipate; Apr 21st, 2004 at 07:45 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width