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

Subreport not showing on Main Report when empty

Status
Not open for further replies.

dr00bie

Programmer
Feb 19, 2004
108
US
I have a main report which has 24 subreports on it. If there is data available for all the reports, then everything is fine, but if one of the subreports doesn't have data, then the subreport just doesn't show at all.

I have edited the reports to test for the HasData event. The reports work fine if I run them alone, but when they are incorporated as subreports it gets weird. How can I make these subreports show even if the query returns no records?

Thanks,
Drew
 
Hi
Would making a textbox visible, when there is no data, suit as a work around?
 
Why do you want to show something when there is not any data to display?

A possible solution assuming you have a link master/child field of something like "ProjectID". Your subreport displays expenses from tblProjectExpenses which has the ProjectID field. You can add tblProjects to your subreport's record source and join the ProjectID fields. Change the join to display all records from tblProjects. This query should return a record for each project even if there are no expenses for a project.

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]
 
Well, the report, when run alone returns 0 and a total of 0... but when I incorporate the report into a subreport it just doesn't show... I want it to at least show the heading of the report and the 0's...

Thanks,
Drew

 
The only reason that I am using these as subreports is because there are 24 of them and they only take up 1/4 of the page, so there is a lot of wasted paper when printing them off one by one, so I thought I would make a report, and have a bunch of subreports to save paper.

Thanks,
Drew
 
You can remove the headings from the subreports and place them in the main report. Otherwise try my other suggestion.

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]
 
make sure the subreports can shrink is set to no

Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top