Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2005

    Unanswered: Search for records containing text in a text box fields

    Help please with building a search box on a form.

    I'd like the user to be able to combine
    1. an option group that will pick one of three fields containing a "TYPE"
    2. enter a text phrase in textbox1 that will find all records that contain any part of the entered text and if the user wants -
    3. enter a text in textbox2 to narrow down the search....

    or do you have a better way - like the google search box - enter any number of words (ok - I could limit the number to four) to search for a record (On Field DESCRIPTION) to find ALL records that contain all the words or parts of those words somewhere in the DESCRIPTION.

    I think that what's needed is to build the recordsource using the "LIKE *textbox2*" AND "LIKE *textbox2*" or something like that.....

    THANKS in advance!!

  2. #2
    Join Date
    Aug 2009
    Using timer control of 100ms in key phrase on a text box it will enable.
    using sql queary like: "SELECT customer*.customer WHERE customer.customer_id= ' " & txtfind.text & " ';"
    when record found timer will stop.
    I think it will help you with key phrase

  3. #3
    Join Date
    Jun 2004
    Arizona, USA
    maruful_islam: Using the timer to repeatedly SELECT data every 100 ms really is NOT kind to the database... I would not reccomend this approach...

    ArthurE212:What database are you using?

    Standard wildcards in SQL are the underscore (_) for a single character match, and the percent (%) for any number of characters.

    You best bet is to build a stored procedure in the database server, and pass it the parameters.

    It can then separate the words in the first textbox, build a query with a where clause of [code]WHERE (TextField Like '%word1%' or TextField Like '%word2%' or ... ) AND TextField Like '%SupplementalWord%'

    The stored procedure can then return the records matching the search criteria to the client.
    edit=loquinWhoops. Didn't notice that Arthur posted his initial question 2.5 years ago... Then, checked his profile to see that he hasn't been back since...
    Last edited by loquin; 08-27-09 at 16:44.
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert

  4. #4
    Join Date
    Aug 2009

    Search for records containing text in a text box fields

    Microsoft Office Access 2007

  5. #5
    Join Date
    Mar 2003
    The Bottom of The Barrel
    Provided Answers: 1
    You might want to look at creating a full text index on SQL Express instead, depending on how robust you need this to be.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

Posting Permissions

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