G
Guest
Hi there,
My situation is actually quite simple, but for some reason, I can't get my
sub-total calculation to work.
I have a continuous form (called: frmTransferDetails) with a field called
"Amount". This form is a sub-form of frmTransfers.
All I am trying to do is check a couple of conditions to see if I should
keep the amount the same, or multiply it by -1.
I'll try to lay out my formula as reader friendly as possible:
=Sum(IIf(([TransType]=2 And
DLookUp("[CreditAccount]","tblAccounts","[AccountID] =" &
[Forms]![frmTransfers]![cboFromAccountID])=0) Or
([TransType]=1 And DLookUp("[CreditAccount]","tblAccounts","[AccountID] =" &
[Forms]![frmTransfers]![cboFromAccountID])=-1),[amount],[amount]*-1))
I know it's kind of a beast to look at.
I've toyed around with this and when I take out the Sum() part of the
formula and tested it on individual records and it appears to work fine. The
criteria checks the correct data and gives me the appropriate value when I
select the record. However, when I put the sum() around the formula, I get
an #Error and can't figure out why.
Can someone lend some assistance?
Thank you!!
My situation is actually quite simple, but for some reason, I can't get my
sub-total calculation to work.
I have a continuous form (called: frmTransferDetails) with a field called
"Amount". This form is a sub-form of frmTransfers.
All I am trying to do is check a couple of conditions to see if I should
keep the amount the same, or multiply it by -1.
I'll try to lay out my formula as reader friendly as possible:
=Sum(IIf(([TransType]=2 And
DLookUp("[CreditAccount]","tblAccounts","[AccountID] =" &
[Forms]![frmTransfers]![cboFromAccountID])=0) Or
([TransType]=1 And DLookUp("[CreditAccount]","tblAccounts","[AccountID] =" &
[Forms]![frmTransfers]![cboFromAccountID])=-1),[amount],[amount]*-1))
I know it's kind of a beast to look at.
I've toyed around with this and when I take out the Sum() part of the
formula and tested it on individual records and it appears to work fine. The
criteria checks the correct data and gives me the appropriate value when I
select the record. However, when I put the sum() around the formula, I get
an #Error and can't figure out why.
Can someone lend some assistance?
Thank you!!