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!

Subreport to display "no sales" if it has no data

Status
Not open for further replies.

MaddiMond

Technical User
Mar 28, 2005
76
US
I have a subreport with several fields in it. I want it to display "No Sales" if the report has no data.

I tried it the following ways, none of which were successful.

1st: I put the following code into a field in the subreport: IIf ([Sub].Report.HasData = True, [Sub].Report!Comp, "No Sales")

2nd: I put the same code into a field in the parent report. That was also unsuccessful.

Any ideas about what I am missing?

Thanks.

Maddi
 
What do you mean by "put into a field"? Do you actually mean set the Control Source of a text box? If so, the text box should be in the main report and the expression must begin with "=". I'm not sure why you didn't copy and paste your actual expression... Assuming the name of your subreport control is "Sub", try:

=IIf([Sub].Report.HasData = True, [Sub].Report!Comp, "No Sales")


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