H
hdfixitup
I have a form with a subform attached. The subform is always displayed in
datasheet view. I have placed a Total field on the form that references the
Total field on the subform. When the subform has records showing, the Total
field on the form displays the values correctly. However, I get the #Error
message when no records are present in the subform. I have tried IIF
statements using the HasData and IsNull features, only to get #Error. Any
ideas on how to make the Total field on the form read 0 when no records are
present on the subform. I have tried some examples below:
=IIf([Forms]![frmOrder]![fsubOrder].[HasData],[Forms]![frmOrder]![fsubOrder]![Total],0)
=IIf(IsNull([Forms]![frmOrder]![fsubOrder]![Total],0,([Forms]![frmOrder]![fsubOrder]![Total])
#Error on both; any help would be appreciated. Thanks
datasheet view. I have placed a Total field on the form that references the
Total field on the subform. When the subform has records showing, the Total
field on the form displays the values correctly. However, I get the #Error
message when no records are present in the subform. I have tried IIF
statements using the HasData and IsNull features, only to get #Error. Any
ideas on how to make the Total field on the form read 0 when no records are
present on the subform. I have tried some examples below:
=IIf([Forms]![frmOrder]![fsubOrder].[HasData],[Forms]![frmOrder]![fsubOrder]![Total],0)
=IIf(IsNull([Forms]![frmOrder]![fsubOrder]![Total],0,([Forms]![frmOrder]![fsubOrder]![Total])
#Error on both; any help would be appreciated. Thanks