Results 1 to 2 of 2

Thread: Searching through records

  1. #1
    Guest

    Question

    When searching a record I can only get a result if the user has put an exact match, but how can you get results witch contain the entered text. Also is there any way you can just show the results instead of the FindFirst function, and have a button that will show all the records again.

  2. #2
    Fanatic Member
    Join Date
    Oct 2000
    Location
    London
    Posts
    1,008
    The easiest way to do a search like this is to construct a SQL query and then base a recordset on it.

    e.g. using Access and DAO

    Code:
    strSQL = "SELECT * FROM Table WHERE Field Like '*Text*';"
    
    Dim rst as Recordset
    Set rst = db.OpenDynaset(strSQL)
    This recordset can then be displayed on, say, a pop-up form. No need to lose your original recordset.

    Cheers,

    P.
    Not nearly so tired now...

    Haven't been around much so be gentle...

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