Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2013-05-30
1
Medium Priority
?
402 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
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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
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…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Suggested Courses

926 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