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

    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 Very idle programmer
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    4,685
    Try IIf([Procedure] Like "*PCR*",1,0)
    Colin (Mendip Data Systems): Website, email
    Try again. Fail again. Fail better.
    A
    sking for help isn't giving up. Its refusing to give up.

  3. #3
    kdestef1 is offline Novice
    Windows 10 Office 365
    Join Date
    Feb 2021
    Posts
    4
    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 Very idle programmer
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    4,685
    You're welcome
    Colin (Mendip Data Systems): Website, email
    Try again. Fail again. Fail better.
    A
    sking for help isn't giving up. Its refusing to give up.

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 - Senior Forums