Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2010
    Location
    Atlanta, GA
    Posts
    211
    Provided Answers: 1

    Unanswered: Using an IN statement to pass a wildcard to a report?

    I have a report that I use IN statements to pass criteria to. It works great. But What if I wand to pass criteria with a wildcard? For example, I want my code to show me all records in which the WorkCenter starts with a Q. Here is my attempt that is not working:

    Code:
    DoCmd.OpenReport "rptInventory Detail Current Quarter - Report", acPreview, , "WorkCenter IN('Q*')"
    I have tried Q*, LIKE Q*, and other variations with no luck.

  2. #2
    Join Date
    Sep 2009
    Posts
    15
    I guess you can't use wild cards for IN statement. The IN statement should contain EXACT values. LIKE statements works fine on mine.

    Example: DoCmd.OpenReport "test", acViewPreview, , "AU_FN LIKE 'ENG*'"

  3. #3
    Join Date
    Oct 2010
    Location
    Atlanta, GA
    Posts
    211
    Provided Answers: 1
    Quote Originally Posted by jopax0429 View Post
    I guess you can't use wild cards for IN statement. The IN statement should contain EXACT values. LIKE statements works fine on mine.

    Example: DoCmd.OpenReport "test", acViewPreview, , "AU_FN LIKE 'ENG*'"
    Perfect! thank you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •