Results 1 to 5 of 5
  1. #1
    ragsgold is offline Access & Excel Developer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2009
    Location
    Denver,CO
    Posts
    51

    Arrow Combining multiple IIf to one

    Hi All,



    I would like to combine multiple IIf to one . below is the situation.

    I have two colums Batch and Created user. Batch contains information regarding the module from which a transaction processed example AP,AR,CR,etc and when its through these subledger system the Createduser is blank. Now there are exceptions where the created user could be blank and that the reason i have to write this expression. When this crieteria matches i want to write "SYSTEM" in those blanks.

    instead of writing an Iff statement like If batch="AP",if bacth =AR, so on and so forth can i write an statement like

    IIF([Batch] Like IN(AR,AP,CR) And iif([CreatedUSER] ="","System",[Createduser]

    basically i am saying if the crieteria of Batch = to those specific AP,AR,CR etc and if the created USER field is blank then input populate the word "SYSTEM" else populate the actual createuser field data.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    The IN operator will work only in query, not in conditional code.

    Why not just:

    Nz([CreatedUSER], "System")
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    ragsgold is offline Access & Excel Developer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2009
    Location
    Denver,CO
    Posts
    51
    Quote Originally Posted by June7 View Post
    The IN operator will work only in query, not in conditional code.

    Why not just:

    Nz([CreatedUSER], "System")
    now that will update all blanks in Createduser with the word system i also want to fulfill another condition of field BATCh is equal to values AP,AR,CR. both must be true

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    IIf((Batch="AR" Or Batch="AP" Or Batch="CR") AND IsNull(CreatedUSER), "SYSTEM", CreatedUser)
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    ragsgold is offline Access & Excel Developer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2009
    Location
    Denver,CO
    Posts
    51
    Quote Originally Posted by June7 View Post
    IIf((Batch="AR" Or Batch="AP" Or Batch="CR") AND IsNull(CreatedUSER), "SYSTEM", CreatedUser)
    Hi June7 this worked with a little tweak
    IIf(([JEreftrim]="AR" Or [JEreftrim]="AP" Or [JEreftrim]="CR" Or [JEreftrim]="IM" Or [JEreftrim]="SC" Or [JEreftrim]="SM") And ([crusrtrim]=""),"SYSTEM",[crusrtrim])

    i replaced the isnull to ([crusrtrim]="") where crusrtrim is created user then it worked. for some reason it returned with SYSTEM populated for all irrespective whether it was AP,AR etc. but a little tweak did work. Thanks again for your help.

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

Similar Threads

  1. Replies: 7
    Last Post: 10-07-2013, 01:57 PM
  2. Replies: 14
    Last Post: 07-22-2013, 12:39 PM
  3. Combining multiple queries into one
    By kagoodwin13 in forum Queries
    Replies: 1
    Last Post: 03-27-2012, 01:29 PM
  4. Help with Combining multiple Records
    By Jennivere in forum Queries
    Replies: 1
    Last Post: 11-28-2011, 08:05 PM
  5. Combining multiple tables
    By Duncan in forum Access
    Replies: 1
    Last Post: 03-27-2011, 08:41 AM

Tags for this Thread

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