Results 1 to 4 of 4
  1. #1
    davej311 is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2013
    Posts
    2

    Search for special characters

    I need a query that returns records that contain 'special' characters e.g. <> *# etc.

    I've sorted most of them but I'm stuck on how to search for single & double quote marks, i.e. ' & "

    In addition to that, i'm searching for < & >, but i want to exclude strings that look like <xyz> for example.

    Any pointers please?

    If it helps, this is what I'm using so far..
    Like "*[<]*" Or Like "*[>]*" Or Like "*[#]*" Or Like "*[%]*" Or Like "*[;]*" Or Like "*[:]*" Or Like "*/*" Or Like "*[?]*" Or Like "*[.]*" Or Like "*[@]*" Or Like "*$*" Or Like "*{*" Or Like "*}*" Or Like "*|*" Or Like "*^*" Or Like "*[[]*" Or Like "*[]]*" Or Like "*[=]*" Or Like "*[&]*" Or Like "*[+]*" Or Like "*]*"

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    Identify exactly what "special characters" are important to you.
    You can define double and single quotes using
    Dim dblQuote as String
    dblQuote = """"
    Dim snglQuote as string
    snglQuote ="'"

    You can refer to the variable name in your code.

    Be very specific on what is included/excluded.
    You may want to include " < ", and exclude " <a" (where a is any alphabetic).

    You may wish to research "Regular Expressions"

    Good luck.

  3. #3
    lfpm062010 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2013
    Location
    US
    Posts
    415
    Try:
    Like "*[!A-Z0-9]*"

    From my search, it should give you anything that is non alphanumeric in your string.
    It seems to work for me.

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Also, see

    Validation with Regular Expressions
    http://access.mvps.org/access/modules/mdl0063.htm


    The example is for US, Canadian and UK postal codes....... you should be able to modify at least some of the code for your purposes..

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

Similar Threads

  1. Need to delete special characters
    By tlrutledge in forum Queries
    Replies: 1
    Last Post: 08-23-2013, 03:10 AM
  2. Data Validation: check for special characters
    By mabrande in forum Access
    Replies: 11
    Last Post: 08-22-2013, 02:18 AM
  3. Replies: 9
    Last Post: 02-11-2013, 03:09 PM
  4. Special characters in Default Value and Query
    By blacksaibot in forum Queries
    Replies: 1
    Last Post: 03-07-2012, 10:36 AM
  5. Special Characters
    By orgelizer in forum Access
    Replies: 0
    Last Post: 03-20-2007, 08:24 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