problem displaying a subreport with subreports in a main report (1 Viewer)

Funkbuqet

Registered User.
Local time
Today, 14:22
Joined
Oct 30, 2010
Messages
50
Needed a standard looking table at the top of a main report. It combines a bunch of information from different queries and combines it. I created 4 reports and then broke the information I needed down, into the individual cells of the table I needed to display, in text boxes in the report footer. Then I created a report for the table (FrontTable). I put the 4 subreports in the details section and built the table in the page header section. I then referenced all the cells of the table to the corresponding cells in the subreports footers. This was a huge pain, but it worked very well. I set the subreports to Visible=No and shrunk them dow so when viewed all you saw was the finished table. The problem I am having now is, when I tried to insert the FrontTable report as a subreport into my main report it shows up as an empty box. Why is the table I created not showing up now? Any help is appreciated. Thank you.
 

boblarson

Smeghead
Local time
Today, 12:22
Joined
Jan 12, 2001
Messages
32,059
Subreports don't show headers or footers when placed into a main report. So you would need to put the stuff in a GROUP header or footer.
 

Funkbuqet

Registered User.
Local time
Today, 14:22
Joined
Oct 30, 2010
Messages
50
Excellent that worked. thank you. However it has now exposed another issue. It looks good when I am viwing the report but when I switch to print preview and print it some of the values that are displayed as zeros say #Error. Why would it look fine in report view but then show an error when printed?
 

boblarson

Smeghead
Local time
Today, 12:22
Joined
Jan 12, 2001
Messages
32,059
Excellent that worked. thank you. However it has now exposed another issue. It looks good when I am viwing the report but when I switch to print preview and print it some of the values that are displayed as zeros say #Error. Why would it look fine in report view but then show an error when printed?
If you have control sources or VBA that references controls on another report then it isn't necessarily going to work right when the report becomes a subreport. The syntax is different (you need to refer to the subreport CONTROL name - the control on the parent report which houses the subreport and not the subreport name itself unless the two share the exact same name. So, here's a way to set control sources easily to get the actual syntax required (the example is with subforms but subreports would do the same).
 

Funkbuqet

Registered User.
Local time
Today, 14:22
Joined
Oct 30, 2010
Messages
50
That is how I built all of my expressions when I created the FrontTable report. Do I need to change how they are written now that I have put the FrontTable report as a subreport into my main report?
Why does it display correctly in report view but not when printed? Do the 4 subreports that feed the data tot he FrontTable need to be visable in print view to get the data from them?
 

Megan

Registered User.
Local time
Today, 15:22
Joined
Jun 3, 2011
Messages
23
I have been having the same problem (0 shows as #error in print preview).

Neither using Nz in the controls nor following the instructions in the link (nice and clear, thanks, Bob) worked for me. Funkbuget, have you found a solution? Or does anyone know of one?

Thanks for any help!
 

Funkbuqet

Registered User.
Local time
Today, 14:22
Joined
Oct 30, 2010
Messages
50
Megan, the only "solution" that I found was that there had to be data present. For me it shows the #error when the record set does not have record that fits the criteria I set in the subreport. I worked around it by entering zeros in the table when nobody worked in the represented county instead of just not entering a record. Fortunately for me that did not require entering incorrect information, not sure if that will work in your situation since null and zero are not interchangeable in all instances.

sorry I couldn't be of more help. GL
 

Megan

Registered User.
Local time
Today, 15:22
Joined
Jun 3, 2011
Messages
23
Thanks for the reply. The problem in my case appears to be that the controls I'm referencing are in the report footer section of the subreports, though I'm not sure how to do the calculations otherwise (the calculations have different record sources). I'm pretty new at this.

I'm glad you found something that works for you. I can make it work, it just won't be as pretty as I'd like under the hood. :)
 

Funkbuqet

Registered User.
Local time
Today, 14:22
Joined
Oct 30, 2010
Messages
50
yes I had a similar issue with the table I was talking about above. It references 4 subreports in thiamin report footer, but it didn't want to see any of them. However if you hide group header they are in they won't populate the main report. But you can set the all individually to visible=no and shrink them down to a few pixels each. Then shrink the group header down as well. It adds an extra space (minimum of a few pixels) below the main report, but on mine you don't even notice.
 

Users who are viewing this thread

Top Bottom