Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How make subreport shrink if value of a feild on the mainreport is "0"

Posted on 2013-05-30
1
Medium Priority
?
396 Views
Last Modified: 2013-05-30
I have a report that has a subreport in the details section of the main report.  If the value of a certain field in the detail section of the main report is "0" then I want the subreport so shrink to 0" vertically in the detail section of the main report.

I have everything set to can shrink = yes in the detail section of the main report and also in the detail section of the subreport.  (The only section of the subreport with anything in it is the detail section).

Here's my onprint code for the detail section of the main report which isn't doing anything... (I also tried this in the onformat event)

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)

    If Me.txtSumOfScrap.Value = 0 Then
        Me.rptInternalScrapReportDefectCauses.Visible = False
        Else
        Me.rptInternalScrapReportDefectCauses.Visible = True
    End If

End Sub
0
Comment
Question by:SteveL13
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 2000 total points
ID: 39208887
Setting the Visible property won't allow Access to reclaim that space, but you might be able to set the .Height of the Subreport CONTROL to 0. I've not used that technique - it's better to fix your record pulls to ONLY pull valid data - but it may work.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

661 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question