Rabu, 22 Oktober 2014

Re: [MS_AccessPros] No Data on Report

 

Sarah-


That really doesn't make sense.  A report with a subreport normally has some relationship between the data in the outer report and the data in the subreport.  If there is no relationship, then putting the two sets of records in separate subreports with no Record Source in the outer report makes more sense.  What is in the outer report and the subreport?  Why are you printing two unrelated sets of data in one report?

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)




On Oct 22, 2014, at 4:49 PM, sarahk@schemesoftware.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:



I dont know if I explained correctly:
In this case the main report has no data, the subreport does have data. So I would like like to print the subreport without the main report.
Sarah

---In MS_Access_Professionals@yahoogroups.com, <JohnV@...> wrote :

Sarah-

Rajiv makes some excellent suggestions.  I'm wondering why the data on the report and subreport aren't related.

Another trick with subreport controls:  Make sure they have Can Grow set to True and design them on the report so that they have no border and are just 0.1" high.  If there are no rows, the subreport won't expand beyond that.  If there are rows, it'll expand to display them all.

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)




On Oct 22, 2014, at 8:03 AM, Rajiv torajiv@... [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

you can also try 

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)      If Me.subrpt1.Report.HasData = True Then          Me.subrpt1.Visible = False
Else Me.subrpt1.Visible =true
End If End Sub

On Wed, Oct 22, 2014 at 11:25 AM, Rajiv <torajiv@...> wrote:
Sarah
If the report and subreport are not linked to each other why not have a report with two subreports instead of a report and subreport?

In the onformat event on the parent report you can use a dcount function to determine the number of records of each report and then make the one with no records invisible.

example
if nz(dcount("[id]","qryOne"),0)=0 then
report1.visible=false
else
report1.visible=true
endif

similarly for second report.

Rajiv




On Wed, Oct 22, 2014 at 5:04 AM, sarahk@... [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:
 

 

I have a report with a subreport. The data for the report and the subreport are coming from 2 different queries. If the report has no data, I would still like to print  the subreport. But when I test for no data and cancel the report , it does not print the subreport. How do I do this?.

If I print the report with no data, it looks ugly, because there are '#error's printing on the report.

As always, thanks in  advance for your help

Sarah

 





__._,_.___

Posted by: John Viescas <johnv@msn.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (6)

.

__,_._,___

Tidak ada komentar:

Posting Komentar