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

Text box with subreport value incorrect when subreport not visible

Status
Not open for further replies.

cjashwell

MIS
Jul 10, 2001
80
GB
Hi,

I'm tearing my hair out over this problem. I'm working with Access 2000, and I have a report, based on a query, which contains a subreport in order to show a subset of the main query's data. I can set a text box in my main report to show the values I want from the subreport using the format:

=[subGenderCount].Report!txtYearTotal

However, when I set the subreport's Visible property to 'No' the text box returns an incorrect value. Similarly, when I set the group header section containing the sub to not visible, the same probelm occurs.

When I put the subreport in the same section as the text box, an incorrect value is returned.

In all cases I can see that the subreport is properly linked, and is returning the correct values, it's just when it is hidden the 'linked' text box is thrown out.

Can anyone shed any light on this?

Many thanks,
CJA
 
When you set the sub report to not visible, you are basically saying you don't want it to have anything to do with the report. So, if that text box has a value that is based on the sub report, you will need to find a way to pass that value to the text box and bipass the subreport.
 
Thanks for that.

I have actually managed to solve the problem.

The control in the subreport being referenced by the text box in the main report had to be placed at the 'bottom' of the sub - in the top grouping level (but in a group footer).

I don't know why this worked, but it has! The only problem I have now is that the 'Hide Duplicates' property of a bound control seems to have stopped working, even though there's nothing in the header for the group that the control belongs to ...

Any thoughts?
 
The problem that is now working is probably due to how you have your groups set up. As for the other problem, not sure about it. It is difficult to know whithout seeing the grouping structure. It is another item that depends on how your report is grouped.
 
Thanks hneal98. I have solved the 'hide duplicates' problem by setting the size of the header for the group in question to 0cm, as per MSAccess help guidance.

Thanks for your interest in this problem.

Have a great day!

CJA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top