Subreport not displaying

J

J Sedoff

I have a report that is calculating some week to date numbers, ordered by
machine and category. I have created a subreport that displays the totals by
category, and a grand total for each column (target, actual, loss, etc.);
however, the subreport is not displaying. That is, when I run the subreport
on its own, it runs fine; when I run the report, I get the report and the
subreport's title (I haven't set it Visible to No yet), but no subreport.

Any suggestions?
 
K

Klatuu

When a subreport doesn't display, that means it found no data. Check to be
sure your Link Master and Link child fields in the subreport control are set
properly.
 
J

J Sedoff

I just used the Toolbox to add in a subreport and let the Wizard do its
magic, is there something that I need to manually change?
 
K

Klatuu

I don't know. I'm not sure how the wizard does it. I don't use wizards.

But here is what to check. When you create a sub report, you actually are
creating a subreport control on the report. It has 3 important properties.
The Source Object property - It tells the control which report object to
display.
The Link Master Field(s) property - It is one of the two properties that
links the data in the main report to the data in the subreport. It should be
the name of the field or fields in the main report's record source that
relates to the subreport's record source.
The Link Child Field(s) property - This should be the name of the field or
fields in the subreport's record source that identifies which record in the
main report's recordsource the records to be displayed in the subreport
belong to.

So, A subreport shows the records in the subreport's record source that
belong or relate to a record in the main form. If the record in the main
form has no child records, then the subreport does not display.

This can also happen if the relationships are not correctly established.
You may get no subreport for any record in the main report.
 
J

J Sedoff

How do you make a subreport without a wizard? When I select
subreport/subquery in the Toolbox and click anywhere, I get a wizard? Are
you simply creating a pack of textboxes with lots of ControlSource code?
 
K

Klatuu

That's how I do it. Not saying not to use wizards. Just saying I don't.
I open a new report, define the query for the record source, set my sorting
and grouping, and start dragging fields from the field list to the sections I
want them to be in.
If it is going to be a sub report, after I have saved it, I open the main
report, put the sub report control where it needs to be, put the name of the
report object I created for it, put the names of the link fields and then
start testing.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top