Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    May 2003
    Location
    Washington, District Of Columbia, USA
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Wildcards in an expression (2000)

    I am adding search capabilities to a database and was wondering how to use a wildcard in an expression. I know a "Find" button would be much easier, but I'd like to use an event procedure that searches the "Title" field for partial matches of a word or phrase entered by the user. I tried using a macro which opened the form I wanted with the criteria: [title]=*[value from textbox]*. That doesn't work. Am I on the right track and if so, can anyone tell me the correct syntax? If not, any alternatives are welcome. Thanks.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Wildcards in an expression (2000)

    In order to use wildcards, you must use Like in the where-condition, not =, and since Like implies that you are comparing to a string, you must use quotes:<pre>"[Title] Like '*" & [value from textbox] & "*'"</pre>


  3. #3
    New Lounger
    Join Date
    May 2003
    Location
    Washington, District Of Columbia, USA
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Wildcards in an expression (2000)

    Thanks. That worked.

Posting Permissions

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