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

If Subreport NoData Then Don't Show Main

Status
Not open for further replies.
Aug 16, 2002
3
US
First, thank you for answering my question, it is much appreciated!!!

Here's my question:
How do I get data in the main report to not show up if the computation of my subreports is equal to 0.

I have a report in my database that displays every customer name and computes their balance. There are three subreports linked to the customer name, Paymenst (from the payments table, InvoiceCharges (from the invoice table), and ServiceCharges (from the service charge table).

The totals for each subreport are first referenced on the main form, and then computed in a field based on the references.

Now, if the balance is equal to 0, then I don't want the customer name and record to show up on the main report. I already have this, but it doesn't work

The Total field (The one that computes the balance) looks like this:

=IIf((Reports!...InvoiceCharges-ServiceCharges)-Payments = 0,SetValues,Reports!...InvoiceCharges-ServiceCharges)-Payments)

My SetValues function looks like this

Function SetValues()
Me.Total.Visible = False
Me.CustomerName.Visible = False
.....(You get the idea)
End Function

Anyway, it doesn't work, everything still shows up. Now if I stick a message box into the function that will pop up.

On a related question, maybe I'm going at this all wrong, is there a better way to list all customers and their computed balances?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top