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 1

Status
Not open for further replies.

EasyOnly

Technical User
Oct 11, 2008
55
US
Hi All,

I have a report that contain 6 subreports. The problem I have is the following: some of the subreport may have no data depending on the client. I want the sub report no to show if there is no data and a massage would show in the location of the subreport indicating that there was no data to show. Right now, if 3 of the subform have no data, it will be balnk but the space is taken by the subreport.

Any suggestions would be greatly appriciated!!

 
I placed the following in the control source in the texbox but did not do anything.

=IIf(Report9.Report1.HasData, Null, "Message to Display")

Thanks
 
If Report9 is your main report and Report1 is your subreport control name then you have done this wrong. In my expression, [blue].Report.HasData[/blue] remains the same regardless of names you have given your controls. [blue]subrptA[/blue] is the name of the subreport control which mignt or might be the same as the Source Object of the subreport control.

Duane
Hook'D on Access
MS Access MVP
 
Sorry for the delay but I created a textbox2 and placed IIf(Report9.Report.HasData,Null,"Message to Display") in the control source of the textbox but for somereason it is not working...
 
What do you mean by "not working"?

Do you understand what I mean by "the name of the subreport control which might or might not be the same as the Source Object of the subreport control"?

Is textbox2 in the same report section as Report9?

Duane
Hook'D on Access
MS Access MVP
 
Here is what I have done:

I added texbox2 and the control source is the following:=IIf(KPIComments_rpt.Report.HasData,Null,"Message to Display")

I placed textbox2 under the subreport named KPIComments_rpt

the subreport source object is Report.KPIComments_rpt

The sureport is placed in a report named for now number1

when I preview the report in a client who has no data, it shows Texbox2 and it does not show the message written in it.....
 
I am not by any means is a wizard but if you go into property of the SUB - there is an Option - On No Data and you can write the code given to you above on this event.

It worked for me, good luck!
 
I assume the subreport and the text box are in the same report section.

Are you suggesting that even though there is no data in the subreport, you don't see "Message to Display"? What do you see of the text box? Does it have a border?

Duane
Hook'D on Access
MS Access MVP
 
it show nothing but text2
and no information in it.

after entering the code, it change to

=IIf([KPIComments_rpt].[HasData],Null,"Message to Display") in brackets.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top