Results 1 to 4 of 4
  1. #1
    kdestef1 is offline Novice
    Windows 10 Office 365
    Join Date
    Feb 2021
    Posts
    7

    Expression for CONTAINS

    I am building a report using an existing form image. A lot of the form contains checkboxes. I am trying to write an expression for a checkbox that looks for a particular word instead of equal to an exact phrase. For example, I have a list of procedures (test names) that contains the acronym in this case, "PCR" (SARS COV-2 PCR, RESPIRATORY PATHOGEN PCR PANEL, etc.). I googled this and found a couple different scenarios, but none of them work.

    Suggested expressions:
    =IIf([Procedure]="*PCR*",1,0)
    =IIf([Procedure] Like "PCR",1,0)

    What is the function that tells Access to look for a certain word within a string of words?



    Thanks!
    Kelly

  2. #2
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    Try IIf([Procedure] Like "*PCR*",1,0)
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  3. #3
    kdestef1 is offline Novice
    Windows 10 Office 365
    Join Date
    Feb 2021
    Posts
    7
    THANKS isladogs!! That did the trick! I had variations of what you posted, so I was close, thanks for getting me across the finish line!

  4. #4
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    You're welcome
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

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

Similar Threads

  1. Replies: 4
    Last Post: 10-15-2020, 10:13 AM
  2. Replies: 2
    Last Post: 03-11-2019, 01:26 PM
  3. Replies: 2
    Last Post: 11-16-2017, 03:33 AM
  4. Replies: 4
    Last Post: 05-03-2016, 01:51 PM
  5. Replies: 2
    Last Post: 11-20-2012, 03:21 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