Results 1 to 5 of 5
  1. #1
    Vegaanders is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2016
    Location
    Cyprus
    Posts
    29

    Error message #Type!

    Hi!



    I have created a report. One field I only want to show if it is not empty. I have done this in a textboc
    Code:
    ="Expenses: "+[Expenses]
    When field is empty it works, nothing is visible, but when it has a value I get the error: #Type!

    What am I doing wrong?

    Regards

    Anders

  2. #2
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    You should always use "&" as the concatenation character.

    The fact that it works is probably just a coincidence, because in the expression "Expenses: "+[Expenses], if [Expenses] is Null, the whole expression is Null.

    Try: iif(isNull([Expenses]),"","Expenses: " & [Expenses])

  3. #3
    Vegaanders is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2016
    Location
    Cyprus
    Posts
    29
    It say there is an extra ) somewhere. For me it looks OK

    Anders

  4. #4
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    I don't see anything wrong, either. Did you have the leading "=" sign there? =iif(isNull([Expenses]),"","Expenses: " & [Expenses])

  5. #5
    Vegaanders is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2016
    Location
    Cyprus
    Posts
    29
    I took it away and pated it again. And now it works perfect. Thanks!

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

Similar Threads

  1. Replies: 7
    Last Post: 03-17-2016, 05:53 PM
  2. Type 13 (Type Mismatch) error
    By sdel_nevo in forum Programming
    Replies: 5
    Last Post: 01-22-2016, 10:01 AM
  3. Data type message
    By George in forum Access
    Replies: 5
    Last Post: 12-31-2014, 11:26 PM
  4. Replies: 15
    Last Post: 11-01-2013, 03:24 PM
  5. Replies: 7
    Last Post: 07-24-2013, 02:01 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