Results 1 to 4 of 4
  1. #1
    Cobbdj is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Sep 2013
    Posts
    3

    IIF Statement to replace " "

    Hello,

    I am trying to populate " " with the following script in Access:



    Expr1: IIf([dbo_CMC_CLCL_CLAIM].[CLST_MCTR_REAS]=" ",[CER_SYML_MSG_LOG].[SYMD_MSG_CD],[dbo_CMC_CLCL_CLAIM].[CLST_MCTR_REAS])

    However, it is not showing the "SYMD_MSG_CD", but another code all together. Can someone give me some direction?

  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,770
    That looks like a space within quote marks. If you want to check against empty string, don't use space.

    Do you allow empty strings in table? I don't. I look for null.

    Expr1: IIf(IsNull([dbo_CMC_CLCL_CLAIM].[CLST_MCTR_REAS]),[CER_SYML_MSG_LOG].[SYMD_MSG_CD],[dbo_CMC_CLCL_CLAIM].[CLST_MCTR_REAS])

    Is there more than one field in the query with same name? If not, don't need the table prefix.

    If you want to handle possibility of either null or "":

    Expr1: IIf([dbo_CMC_CLCL_CLAIM].[CLST_MCTR_REAS] & "" = "", [CER_SYML_MSG_LOG].[SYMD_MSG_CD], [dbo_CMC_CLCL_CLAIM].[CLST_MCTR_REAS])
    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
    Cobbdj is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Sep 2013
    Posts
    3
    Actually, this database contains " " (padded spaces). I will try running the suggested script you provided. hopefully, that generates the correct results..... I have been working on this for a week.....Ugh!

    Thanks,

    Dina

  4. #4
    Cobbdj is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Sep 2013
    Posts
    3
    That worked! Thanks a bunch!

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

Similar Threads

  1. Replies: 2
    Last Post: 10-10-2012, 02:51 PM
  2. Replies: 6
    Last Post: 07-25-2012, 06:42 AM
  3. urgent! replace "-" with nothing
    By bet in forum Programming
    Replies: 1
    Last Post: 03-27-2011, 07:32 AM
  4. replace values with "indicators"
    By JoeMap in forum Reports
    Replies: 3
    Last Post: 06-16-2010, 10:19 AM
  5. replace a empty field with the word "none" how??
    By techexpressinc in forum Queries
    Replies: 1
    Last Post: 01-15-2010, 11:02 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