Results 1 to 9 of 9

Thread: #Type Error

  1. #1
    tomnsd is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2013
    Posts
    17

    #Type Error

    I am trying to use a formula in a report control
    Code:
    [Weight]/[Table]
    . Both the fields are from a table called PL_Summary_2 and both fields are numeric in the table. When I run the report I get a #Type! error returned. I imagine the table needs to be referenced in the formula, but I am not sure of the Syntax.

  2. #2
    June7's Avatar
    June7 is online now Moderator
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    24,217
    The expression is in textbox ControlSource? Did you precede the expression with an = sign?

    It is not required to prefix with table name unless the datasource is a query joining tables that provide fields with the same name.
    To provide db: Make copy, remove confidential data, run compact & repair, zip if large - 2mb allowed, attach to post. Attachment Manager is below the Advanced post editor window.
    If suggestion in this post resolves your issue, please use the Thread Tools and mark the thread as Solved!

    Debug!Debug!Debug! http://www.cpearson.com/excel/debug.htm

  3. #3
    tomnsd is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2013
    Posts
    17
    Yes, it is a text box and it is proceeded by "="

  4. #4
    June7's Avatar
    June7 is online now Moderator
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    24,217
    Then I have no idea why this errors. If you want to provide db for analysis, follow instructions at bottom of my post.
    To provide db: Make copy, remove confidential data, run compact & repair, zip if large - 2mb allowed, attach to post. Attachment Manager is below the Advanced post editor window.
    If suggestion in this post resolves your issue, please use the Thread Tools and mark the thread as Solved!

    Debug!Debug!Debug! http://www.cpearson.com/excel/debug.htm

  5. #5
    ssanfu is offline VIP
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    2,937
    I'm not saying that this is the problem, but you have
    Code:
    [Weight]/[Table]
    "Table" is a reserved word in Access. Reserved words should not be used as object names.

    A list of reserved words is at
    http://allenbrowne.com/AppIssueBadWord.html

    Using a naming convention tends to avoid this reserved word problem.


    Another thought..
    In form design view, check to see if the field names you typed in the control are in the Field list available to the form.
    I use A2000, so I don't know where the field list button is located in the ribbon.

  6. #6
    June7's Avatar
    June7 is online now Moderator
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    24,217
    Yes, good to avoid reserved words (as well as spaces and special characters/punctuation - underscore is exception), however, the [] should force acceptance of the field name.

    The field list can be activated on the Design tab > Tools section > Add Existing Fields.
    To provide db: Make copy, remove confidential data, run compact & repair, zip if large - 2mb allowed, attach to post. Attachment Manager is below the Advanced post editor window.
    If suggestion in this post resolves your issue, please use the Thread Tools and mark the thread as Solved!

    Debug!Debug!Debug! http://www.cpearson.com/excel/debug.htm

  7. #7
    tomnsd is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2013
    Posts
    17

    #Type Error Sample File

    I've attached the Access Database with the problem. Please look at the report.

    Thanks.
    Attached Files Attached Files

  8. #8
    June7's Avatar
    June7 is online now Moderator
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    24,217
    With the report in design view you will see a little green triangle in the upper left of the textbox. Click it and you will see explanation of the error. All of these textbox errors are due to circular reference. Give the textbox a name different from field referenced in the expression, like tbxWeight.
    To provide db: Make copy, remove confidential data, run compact & repair, zip if large - 2mb allowed, attach to post. Attachment Manager is below the Advanced post editor window.
    If suggestion in this post resolves your issue, please use the Thread Tools and mark the thread as Solved!

    Debug!Debug!Debug! http://www.cpearson.com/excel/debug.htm

  9. #9
    ssanfu is offline VIP
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    2,937
    I would do all of the calculation in a query instead of in the report controls.
    Much easier, IMO...

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

Similar Threads

  1. Error: Run-time error '13' Type mismatch
    By uronmapu in forum Access
    Replies: 1
    Last Post: 09-07-2012, 04:38 AM
  2. type mismatch error 13
    By Compufreak in forum Access
    Replies: 3
    Last Post: 08-10-2012, 02:48 AM
  3. Type conversion error
    By corymw in forum Access
    Replies: 1
    Last Post: 07-25-2012, 10:55 AM
  4. Replies: 1
    Last Post: 05-11-2012, 09:59 AM
  5. Error 13 Type Mismatch error
    By GlennBurg in forum Programming
    Replies: 1
    Last Post: 06-21-2011, 02:05 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
  •  
Tech Forums: Microsoft Office Forums