One more shot ...
=nnz(DSum("[Mod Price]", "[Mods Detail Query]", "[Order ID]= " & [Order ID]))
| DebbieG wrote:
|
| > I have this function in a module:
| >
| > Public Function nnz(TestValue As Variant) As Variant
| > If Not (IsNumeric(TestValue)) Then
| > nnz = 0
| > Else
| > nnz = TestValue
| > End If
| > End Function
| >
| >
| > =DSum("nnz([Mod Price])", "[Mods Detail Query]", "[Order ID]= " & [Order
ID])
| >
| > HTH,
| > Debbie
| >
| >
| > | > | Van T. Dinh wrote:
| > | > Try:
| > | >
| > | > =NZ(DSum("[Mod Price]", "[Mods Detail Query]",
| > | > "[Order ID]= " & [Order ID]), 0)
| > | >
| > | > (I am guessing you have a TextBox Control [Order ID] on the Form. If it
| > | > doesn't work, you have to explain where the value of [Order ID] comes
from.)
| > | >
| > | I found the problem....but not the answer. The problem is...
| > | On the first Subform I have records,
| > | On the second Subform I have records that are associated with the first
| > | Subform. On each, in the footer I have an unbound textbox that totals
| > | the dollar amounts. It all works fine if the second Subform always has
| > | a record in it. But if the second Subform doesn't have a record in it
| > | the unbound textbox on the second form gives me nothing. I also found
| > | that I needed an IIF statement instead of the NZ, so I'm using
| > | this...instead.
| > | =IIf(IsNull([Mod Price]),0,DSum([Mod Price],"Mods Detail Query",[Order
| > | ID]=[Order ID]))
| > |
| > | Any suggestions would be most helpful.
| > | Thank You
| > | DS
| >
| > No, didn't work. Is there anyway to have the calculated field just grab
| the records that are greater than 0, and not null?
| Thanks
| DS