Results 1 to 3 of 3
  1. #1
    olidav911 is offline Novice
    Windows XP Access 2000
    Join Date
    Jun 2009
    Posts
    2

    Making the like operator work for fields

    Hi I am trying to compare two fields in different tables and I need to do a like because it is searching for specific characters in the whole field. I've got - like "*[tablename].[fieldname]*". Unfortunately the " marks will make it look for whatever is inside it rather than in the table itself. Does anybody know a way round this? I hope I've made myself clear!

  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
    To start with you can not just qualify a field with a table name and expect anything useful to happen in Access. You need a RecordSet for the [TableName] and pull the [FieldName] into a variable so you can search with the Like operator and wild cards.l

  3. #3
    thhui is offline Competent Performer
    Windows XP Access 2002 (version 10.0)
    Join Date
    Feb 2009
    Posts
    235
    You have to set the criteria below instead:-

    Code:
    Like '*' & [TableName].[FieldName] & '*'

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

Similar Threads

  1. Missing Operator error
    By data123 in forum Forms
    Replies: 1
    Last Post: 03-15-2009, 04:34 PM
  2. Forms don't work the same
    By hawzmolly in forum Access
    Replies: 0
    Last Post: 12-18-2008, 05:46 PM
  3. Making fields dissapear
    By rev_ollie in forum Access
    Replies: 0
    Last Post: 09-11-2008, 03:56 PM
  4. making specific fields non-editable
    By narayanis in forum Forms
    Replies: 3
    Last Post: 08-06-2008, 12:22 PM
  5. Can't get TransferSpreadsheet to work
    By Valeda in forum Import/Export Data
    Replies: 0
    Last Post: 07-19-2007, 08:04 AM

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