A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

SubReport No Data printing problem



 
 
Thread Tools Display Modes
  #1  
Old August 9th, 2004, 07:45 PM
Tony_VBACoder
external usenet poster
 
Posts: n/a
Default SubReport No Data printing problem

With Access 2002, I have a SubReport with items listed in
a grid-like format. This subreport is linked to a field
on the Main Report. The problem I have is, when the
SubReport has no data to link to, I get a blank area on my
Main Report, where the subreport is supposed to be. To
work around this, I created a dummy un-bound subreport
with a grid-like layout (4 blank rows) of unbound text
boxes and some horizontal and vertical lines, so that I
get some blank rows to appears. I placed my dummy
subreport behind my Bound-subreport at the same Top
position as my bound-subreport, so that when the bound-
subreport has no data, the dummy subreport will show
through. The problem is, my bound-subreport moves below
my dummy subreport, leaving a large gap in my Main Report.

Is there a way that I can determine if my Bound-subreport
has any data, that way I can set the Top property of my
dummy subreport to be at the same position as my bound-
subreport? I know I can use the RecordsetClone for a
SubForm, but how can I use this for Report?
  #2  
Old August 9th, 2004, 10:10 PM
Marshall Barton
external usenet poster
 
Posts: n/a
Default SubReport No Data printing problem

Tony_VBACoder wrote:

With Access 2002, I have a SubReport with items listed in
a grid-like format. This subreport is linked to a field
on the Main Report. The problem I have is, when the
SubReport has no data to link to, I get a blank area on my
Main Report, where the subreport is supposed to be. To
work around this, I created a dummy un-bound subreport
with a grid-like layout (4 blank rows) of unbound text
boxes and some horizontal and vertical lines, so that I
get some blank rows to appears. I placed my dummy
subreport behind my Bound-subreport at the same Top
position as my bound-subreport, so that when the bound-
subreport has no data, the dummy subreport will show
through. The problem is, my bound-subreport moves below
my dummy subreport, leaving a large gap in my Main Report.

Is there a way that I can determine if my Bound-subreport
has any data, that way I can set the Top property of my
dummy subreport to be at the same position as my bound-
subreport? I know I can use the RecordsetClone for a
SubForm, but how can I use this for Report?



Report objects have a HasData property that can take care of
this issue. Add code to the Format event procedure of the
main report section that contains the subreports to make the
appropriate subreport control visible or not.

Dim bolData As Boolean
bolData = Me.boundsubreportcontrol.Report.HasData
Me.boundsubreportcontrol.Visible = bolData
Me.unboundsubreportcontrol.Visible = Not bolData

--
Marsh
MVP [MS Access]
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with calculated controls with data from subforms Ragnar Midtskogen Using Forms 8 July 25th, 2004 07:18 PM
Problem with runtime recordsource assignment in subreport Savvoulidis Iordanis Setting Up & Running Reports 1 July 9th, 2004 05:35 PM
Problem copying outlook data Qal General Discussion 4 July 7th, 2004 10:15 AM
Data Access Page Problem Doug Munich General Discussion 0 June 5th, 2004 12:03 AM
Pivot Table Data Refresh Problem [email protected] Worksheet Functions 2 January 6th, 2004 10:34 PM


All times are GMT +1. The time now is 05:06 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.