Results 1 to 2 of 2
  1. #1

    Search Query (Access 2000)

    Hello weekend warriors! I figured something out on my own for once... well kinda lol
    I'm using a query to return records that match a user entered word in one of my forms....
    here's the query sql

    SELECT TSounds.Description Like "*" & [Forms]![SearchKeyword]![Searchbox] & "*" AS SrchReturn
    FROM TSounds;

    Fairly simple - and it works sorta too! Unfortunately for me - it just seems to return numbers and not the record itself... It'll return -1 for True and 0 for false... know what I'm doing wrong?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 28 Times in 28 Posts

    Re: Search Query (Access 2000)

    Hi Dan,

    You should put the Like part in the Where clause of the query:

    SELECT TSounds.Description
    FROM TSounds
    WHERE TSounds.Description Like "*" & [Forms]![SearchKeyword]![Searchbox] & "*";

    In the query as you posted it, you return

    TSounds.Description Like "*" & [Forms]![SearchKeyword]![Searchbox] & "*"

    as a whole, but you want to return TSounds.Description by itself.

Posting Permissions

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