Results 1 to 3 of 3
  1. #1
    datachick is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2014
    Posts
    5

    Iif issues with syntax

    PLEASE LOOK AT MY FORMATTING....SOMETHING IS OFF AND I KEEP GETTING SYNTAX ERROR.






    IIf(([Table1]![ID]="01M20022") or (Mid([PRODUCT],4,1) = "Q" and [Table1]![Date < #3/1/2015#) ,"HIS",
    IIf([Table1]![Field1] In ("CCS20016","CCS20016") or (Mid([PRODUCT],4,1) = "C" and [Table1]![Date < #3/1/2015#) or
    (Mid([PRODUCT],4,1) = "F" and [Table1]![Date < #3/1/2015#) ,"CHIP",
    IIf([Table1]![ID] In ("GFD20017","TGF20017","CAD20017","20017") or
    (Mid([PRODUCT],4,1) = "A" and [Table1]![Date < #3/1/2015#) ,"PRA",
    IIf([Table1]![ID] In ("ERR20036","NMA220036","HES20036"),"PPD",
    IIf([Table1]![ID] ="JRS20026","ERAt",
    IIf([Table1]![ID]="MRA20024","COM","Unknown"))))))

  2. #2
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    The "in" operator you are using in lines 2, 4 and 6 is only valid in SQL, not in standard VBA as you have it.

  3. #3
    datachick is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2014
    Posts
    5
    Thanks for your assistance.

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

Similar Threads

  1. Replies: 5
    Last Post: 06-09-2014, 01:30 PM
  2. web compatibility issues
    By marklove in forum Access
    Replies: 1
    Last Post: 04-18-2013, 07:44 AM
  3. .ldb file issues
    By RachelBedi in forum Access
    Replies: 3
    Last Post: 12-12-2012, 10:47 AM
  4. VBA debuggin issues....
    By sjl in forum Programming
    Replies: 1
    Last Post: 08-29-2011, 01:47 PM
  5. Incomplete Syntax Clause (syntax error)
    By ajetrumpet in forum Programming
    Replies: 4
    Last Post: 09-11-2010, 10:47 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