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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report Calculation

Status
Not open for further replies.

Fish521

Technical User
Nov 3, 2005
29
US
I have a report which I have 2 text box fields in the report footer
=sum([MTM]) and =sum([EID OT'd]); and then a calculation between those 2 text boxes =[txtMTM]-[txtOT]
These calculations work fine if there is an option button marked otherwise it brings back no data. How can I get the txt box to populate with a zero whent he field is Null. I have tried a couple of IF expressions but could not get them to work
 
In an unbound field

=NZ([textMtm],0)-NZ([textOT],0)

The NZ expression allows for any number/text to be substituted for a null
 
Thanks, looks like the calculation is going through now but is there a way to get rid of the error# in that field so it shows 0.
 
If you want a summary text box to display 0 when the report doesn't return any records, you need to use something like:
=IIf([HasData],Sum([YourNumericField]),0)

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top