#Size! and #Type! in controls


  • I have one control that sometimes contains #Size! and one control that sometimes contains #Type!

    The control source for the first is =Nz([Payments].[Form]![TotalPayments],0)

    The referred to form is a subform that has a total control for the row amount. The control is in the subform footer and has "=Sum(Amount)". In this case, there are no rows. I'm guessing I need to somehow ensure that this is set to zero if there are no rows. How would I do that?

    The control source for the second is =[DueAmt]-[PaidToDate]

    DueAmt is the name of a control on the same form that always contains a value. PaidToDate is the name of the first control. I'm guessing the fix for the first control should fix this too.

    Addendum: I should mention that both the main form and subform are read-only, since after doing some research I found that might be relevant.

    Monday, August 12, 2013 9:54 PM


  • I don't really follow the second control's issue, but the first control can deal with a subform without records by using an expression like:

       =IIf(Payments.Form.Recordset.RecordCount > 0, Payments.Form!TotalPayments, 0)

    Or, less specific, by checking for any error:

       =IIf(IsError(Payments.Form!TotalPayments), 0, Payments.Form!TotalPayments)

    Tuesday, August 13, 2013 12:23 AM