Results 1 to 3 of 3
  1. #1
    ezybusy is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Nov 2015
    Posts
    119

    how to fix #Type! error when there is no row of data ?

    Hello,


    I have an independent field on a parent form, and in this field I added the following expression in expression builder in order to display the total of a subform

    Code:
    = TrueFalse (IsNumeric ([EntrySalesDetails]. [Form]! [TxtBigTotal] - [SaleDiscount]); [EntrySalesDetails]. [Form]! [TxtBigTotal] - [SaleDiscount]; 0)
    However, it only works when there is at least one row of data in the subform. But when there is no row I get a #Type! error



    Please can someone help me display 0 when there is no row of data ??

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    A number of questions, please answer all

    1. what is your truefalse function? what does it do? just guessing as to it's purpose but why not use an iif statement?

    2. have you tried using a dot rather than bangs? - they do different things

    3. and what is the control source and what is displayed in your [EntrySalesDetails]. [Form]! [TxtBigTotal] control when there are no records?

    4. I presume the subform is editable and allowadditions is true?

  3. #3
    ezybusy is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Nov 2015
    Posts
    119
    I have got it working. The code is below.
    I only needed to test only the expression which could contain nothing and not the whole calculation

    Code:
    =TrueFalse(IsNumeric ([EntrySalesDetails].[Form]![TxtBigTotal]);[EntrySalesDetails].[Form]![TxtBigTotal]-[SaleDiscount];0)
    Thank you

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

Similar Threads

  1. Data Type Mismatch Error
    By tbbrown32 in forum Programming
    Replies: 30
    Last Post: 12-27-2016, 09:28 AM
  2. Data type Error
    By Glenn_Suggs in forum Access
    Replies: 3
    Last Post: 01-25-2016, 11:30 AM
  3. Data Type Conversion Error
    By graviz in forum Forms
    Replies: 7
    Last Post: 06-04-2012, 11:34 AM
  4. Replies: 1
    Last Post: 05-11-2012, 10:59 AM
  5. Combo Box FK Data Type Error
    By southcraven in forum Database Design
    Replies: 7
    Last Post: 02-02-2012, 09:42 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