Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculated Field problem 1

Status
Not open for further replies.

SColbert

Technical User
Sep 25, 2003
49
US
I've got a form with three calculated fields - Total Pledges Raised, Total Pledges Received and Total Pledges Outstanding for each GolferID record.

Pledges Raised and Pledges Received are calculated through queries and displayed on the form using the DLookup function.

Total Pledges Outstanding is a calculated textbox using the formula [TotalRaised]-[TotalReceived].

My problem is that if the Total Received query contains no data, the Total Outstanding box is blank - I want it to act as if there is a $0 value in Received and to display the value contained in the Total Raised.

example:
Total Raised = $50
Total Received = $0
Total Outstanding = $50 (right now, Outstanding is blank)

All assistance much appreciated!
 
Try for the Total received box

Code:
=IIf(Isnull(Sum([PledgesReceived])),0,Sum([PledgesReceived]))

Have fun! :eek:)

Alex Middleton
 
Thanks for the point in the right direction - because the Total Received value is calcuated in a query I used the IIf(IsNull) function in the Total Outstanding text box & it worked great.
 
Another way:
=Nz(DLookUp(...), 0)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top