Results 1 to 9 of 9
  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 offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    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.
    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
    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 offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Then I have no idea why this errors. If you want to provide db for analysis, follow instructions at bottom of my post.
    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
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    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 offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    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.
    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.

  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 offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    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.
    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.

  9. #9
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    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, 05:38 AM
  2. type mismatch error 13
    By Compufreak in forum Access
    Replies: 3
    Last Post: 08-10-2012, 03:48 AM
  3. Type conversion error
    By corymw in forum Access
    Replies: 1
    Last Post: 07-25-2012, 11:55 AM
  4. Replies: 1
    Last Post: 05-11-2012, 10:59 AM
  5. Error 13 Type Mismatch error
    By GlennBurg in forum Programming
    Replies: 1
    Last Post: 06-21-2011, 03: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
  •  
Other Forums: Microsoft Office Forums