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!

Creating a message based on a value in a subreport

Status
Not open for further replies.

Creosote65

Technical User
Jun 28, 2004
29
US
Hi,

I've been looking around the site for someone who has a similar problem to this, but I can't find one.
I would like to generate a message in a text box, but only in the event of the existence of a particular value in a subreport. The value is "Hist" in a field called "Type". The subreport is called "Equipment" and the report is called "Usage".
The subreport may contain more than one value, so I can't use an "iif" statement based on "HasData".

Any help will be really useful.

Regards,
Creo
 
Assuming you have a
- subreport "Equipment" on a main report and
- the subreport has a field "Type" and
- you need to note on the main report if there is a value of "Hist" in the subreport in the field

Add a text box to your report footer of the subreport:

Name: txtCountHist
Control Source: =Sum([Type]="Hist")

Then in your main report (in the same section as the subreport) add a text box:

COntrol Source: =IIf(Equipment.Report!txtCountHist=0,"not there","is there")

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