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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|
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 |