Results 1 to 8 of 8
  1. #1
    aamer is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Location
    Pakistan
    Posts
    276

    How To add Words

    I am using the following statement in a query

    XREM: IIf([Rstatus]=Null,[Rstatus],[Remarks] & " " & [Customers Bank])

    The Result I get is:

    Without Poly Sheet Unsorted Citi Bank

    Without Poly Sheet Unsorted This Is Remarks
    Bank: Citi Bank This is Bank Name





    How can I get the result as

    Without Poly Sheet Unsorted Bank: Citi Bank

    If the bank is not added in the data
    the result should look as follows

    Without Poly Sheet Unsorted


    Not As
    Without Poly Sheet Unsorted Bank:

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Try (to handle NULL)

    iif(IsNull([Rstatus]),[Rstatus],[Remarks] & " " & [Customers Bank])

    I'm not sure what is in your record for sure, but you could try this also

    iif(IsNull([Rstatus]),[Rstatus],[Remarks] & " Bank: " & [Customers Bank])

  3. #3
    aamer is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Location
    Pakistan
    Posts
    276
    Tried both in query

    XREM: iif(IsNull([Rstatus]),[Rstatus],[Remarks] & " " & [Customers Bank])

    AND

    XREM: iif(IsNull([Rstatus]),[Rstatus],[Remarks] & " Bank: " & [Customers Bank])



    The result is BLANK / NULL

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Yes, your test seems backwards

    Try
    iif(IsNull([Rstatus]),[Remarks] & " " & [Customers Bank],[Rstatus])

    I'm not sure what is in your record for sure, but you could try this also

    iif(IsNull([Rstatus]),[Remarks] & " Bank: " & [Customers Bank],[Rstatus])

  5. #5
    aamer is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Location
    Pakistan
    Posts
    276
    XREM: IIf(IsNull([Rstatus]),[Remarks] & " Bank: " & [Customers Bank],[Rstatus])

    This works fine if the CUSTOMER BANK is mention / selected in the data but if it is blank or null then the data looks as follows:

    Without Poly Sheet Unsorted Bank:

    where as What I want is if the CUSTOMER BANK is blank / null it should omit BANK: as the bank is already not there. BANK: should only show if the bank name is selected

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Show us some of the values in Rstatus --- is it Null, "" zero length string or space?
    How is the field defined -? string/text, number or variant

    and use this

    iif(IsNull([Rstatus]),[Remarks] & " " & [Customers Bank],[Rstatus])

  7. #7
    aamer is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Location
    Pakistan
    Posts
    276
    The Value of Rstatus ---- is NULL

    It is a TEXT field

  8. #8
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Show us a few of the records with RStatus.
    Do you mean text field with a value "NULL"???


    See this and NULL

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

Similar Threads

  1. Numbers To Words
    By Derrick T. Davidson in forum Reports
    Replies: 19
    Last Post: 03-20-2013, 02:31 AM
  2. numbers to words
    By chavez_sea in forum Access
    Replies: 14
    Last Post: 01-16-2013, 07:25 PM
  3. Bold only certain words in textbox?
    By NateHaze in forum Reports
    Replies: 1
    Last Post: 06-04-2011, 11:47 AM
  4. Textbox, remove certain words.
    By dgrzalja in forum Forms
    Replies: 0
    Last Post: 11-03-2009, 09:42 AM
  5. tags and words in a row
    By bimfire in forum Access
    Replies: 0
    Last Post: 11-07-2007, 10:53 PM

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