Results 1 to 3 of 3
  1. #1
    supernova122 is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2009
    Posts
    2

    search for "*" character

    I want to search a field which might contain "*" character by using a query. I understand that "*" is using as wildcard and therefore I cannot input "*" directly in the criteria in a query. How can I input "*" as a search criteria in a query? I am using Access 2003. Please advise. Thanks.

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Have you tried using Chr(42)?

  3. #3
    kevsparky is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2009
    Posts
    4
    You need to escape the asterisk. To do so, just enclose it in square brackets.

    To find an asterisk at the start of a string use: If myString Like "[*]*" Then
    To find a string containing just an asterisk use: If myString Like "[*]" Then
    To find an asterisk anywhere in a string use: If myString Like "*[*]*" Then

    That's VBA Code, to use it in a query just take the Like "*[*]*" and put that in the criteria part of the query

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 21
    Last Post: 06-03-2009, 05:54 PM
  2. aSTR = Dir("C:\*.*") >> "Type Mismatch"
    By JGrant in forum Programming
    Replies: 1
    Last Post: 03-28-2009, 05:17 AM
  3. The search for "quote symbols"
    By Dadmail in forum Queries
    Replies: 1
    Last Post: 03-18-2009, 10:52 AM
  4. Replies: 2
    Last Post: 08-31-2006, 12:19 PM
  5. "Count" and "Countif" in Reports
    By JMantei in forum Reports
    Replies: 1
    Last Post: 06-20-2006, 02:20 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
  •  
Other Forums: Microsoft Office Forums