Solved

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

Posted on 2013-05-30
1
392 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 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

739 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