Results 1 to 2 of 2
  1. #1
    Gina Maylone is offline Always learning
    Windows 10 Access 2016
    Join Date
    Jun 2013
    Location
    Afton, MN
    Posts
    544

    Hide subreport when balance is zero

    Good morning!

    I thought I posted this yesterday, but I can't find it anywhere. Apologies for duplication. I need to hide a subreport when the balance is zero. I know I can hide it when there is no data, but that is not the case. I have tried:


    Code:
    Private Sub Report_Current()
    If Reports!groupassessmentstatement.Report![GeneralAccountDetailSubReport]![LegalFees].Report![BalanceDue] <> 0 Then
    Debug.Print "the balance due is" & BalanceDue
    Reports!groupassessmentstatement.Report![GeneralAccountDetailSubReport]![LegalFees].Report.Visible = True
    ElseIf Reports!groupassessmentstatement.Report![GeneralAccountDetailSubReport]![LegalFees].Report![BalanceDue] = 0 Then
    Debug.Print "the balance due is zero"
    Reports!groupassessmentstatement.Report![GeneralAccountDetailSubReport]![LegalFees].Report.Visible = False
    End If
    End Sub
    Private Sub Report_Load()
    If Reports!groupassessmentstatement.Report![GeneralAccountDetailSubReport]![LegalFees].Report![BalanceDue] <> 0 Then
    Reports!groupassessmentstatement.Report![GeneralAccountDetailSubReport]![LegalFees].Report.Visible = True
    ElseIf Reports!groupassessmentstatement.Report![GeneralAccountDetailSubReport]![LegalFees].Report![BalanceDue] = 0 Then
    Reports!groupassessmentstatement.Report![GeneralAccountDetailSubReport]![LegalFees].Report.Visible = False
    End If
    
    End Sub
    with no luck. Thoughts? TIA!! ~PEACE~

  2. #2
    Minty is offline VIP
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,157
    Try setting the subreport container control to Visible = False, not the report?
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Hide Rows in a subreport
    By gemadan96 in forum Reports
    Replies: 5
    Last Post: 05-29-2014, 01:49 PM
  2. Hide Empty SubReport
    By mystifier in forum Reports
    Replies: 0
    Last Post: 06-08-2012, 01:10 AM
  3. Hide Subreport if specific fields are empty
    By hawkins in forum Reports
    Replies: 1
    Last Post: 03-29-2012, 05:08 PM
  4. Hide SubReport
    By TinaCa in forum Programming
    Replies: 6
    Last Post: 09-15-2011, 08:03 PM
  5. Show Hide Subreport / acViewReport
    By BigBear in forum Reports
    Replies: 4
    Last Post: 03-30-2009, 06:07 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums