R
Rob
I need to sum data from two subforms on my main form.
main form sum text box is: (txtBalance)
=[Forms]![frmMain]![fsubFirst]![txtTotal].[Value]-[Forms]!
[frmMain]![fsubSecond]![txtTotal].[Value]
subform 1's sum text box is: (txtTotal)
=Sum([curAmount])
subform 2's sum text box is: (txtTotal)
=Sum([curAmount])
This works great if there is data in both subforms. If
these is no data in either or both forms I get #Error in
the main form's txtBalance box.
I've tried:
=IIf([Forms]![frmMain]![fsubFirst]![txtTotal].[Value] Is
Null,0,[Forms]![frmMain]![fsubFirst]![txtTotal].[Value])-
IIf([Forms]![frmMain]![fsubSecond]![txtTotal].[Value] Is
Null,0,[Forms]![frmMain]![fsubSecond]![txtTotal].[Value])
but that doesn't work.
How can I make txtBalance equal 0 when there is no data in
one of the subforms?
Thanks.
main form sum text box is: (txtBalance)
=[Forms]![frmMain]![fsubFirst]![txtTotal].[Value]-[Forms]!
[frmMain]![fsubSecond]![txtTotal].[Value]
subform 1's sum text box is: (txtTotal)
=Sum([curAmount])
subform 2's sum text box is: (txtTotal)
=Sum([curAmount])
This works great if there is data in both subforms. If
these is no data in either or both forms I get #Error in
the main form's txtBalance box.
I've tried:
=IIf([Forms]![frmMain]![fsubFirst]![txtTotal].[Value] Is
Null,0,[Forms]![frmMain]![fsubFirst]![txtTotal].[Value])-
IIf([Forms]![frmMain]![fsubSecond]![txtTotal].[Value] Is
Null,0,[Forms]![frmMain]![fsubSecond]![txtTotal].[Value])
but that doesn't work.
How can I make txtBalance equal 0 when there is no data in
one of the subforms?
Thanks.