Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2010
    Posts
    186

    Unanswered: Main report with subreport - space trouble

    I've seen alot of posts regarding the subject of too much space in a report where the subreports are not showing any data. I have attached a picture of my report in design view.
    It has 2 group headers...
    the first group header 0 has 2 subreports beneath it.
    It is set to can grow - YES; can shrink - YES
    Both subreport properties are set to can grow - YES; can shrink - YES.
    For sake of design layout, I placed them one on top of the other.
    I wrote code to hide if no data (shown below)
    In testing, I have found that the subreport are hidden when no data with no extra space below the fields at all....as if the subreports weren't even there (which is what I want.)

    Now, when you move down to group header 1....with 4 subreports; I set it up exactly the same; from the grow, shrink, placement, to the code. This whoever, does not work! It leaves all the space as if none of the set-up where there at all!

    Appreciate any input as to what I can be missing!
    Thank you!





    Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As Integer)
    If Me.srFAKES.Report.HasData Then
    Me.srFAKES.Visible = True
    End If
    If Me.SlmnOutstandingCM.Report.HasData Then
    Me.SlmnOutstandingCM.Visible = True
    End If

    End Sub


    Private Sub GroupHeader1_Format(Cancel As Integer, FormatCount As Integer)
    If Me.srCPO.Report.HasData Then
    Me.srCPO.Visible = True
    End If
    If Me.srNOTES.Report.HasData Then
    Me.srNOTES.Visible = True
    End If
    If Me.Slmn_OutstandingCI.Report.HasData Then
    Me.Slmn_OutstandingCI.Visible = True
    End If
    If Me.SlmnOutstandingCO.Report.HasData Then
    Me.SlmnOutstandingCO.Visible = True
    End If
    End Sub
    Attached Files Attached Files

  2. #2
    Join Date
    Jun 2010
    Posts
    186
    It came to me on my drive home - I think I know why this is!

    Group header 0 links on numeric data type, so that code must be correct for numeric.......

    Group Header 1 is linked on text!
    Can anyone recommend how to change the following code considering the linked data is text, so it will trigger??????
    Private Sub GroupHeader1_Format(Cancel As Integer, FormatCount As Integer)
    If Me.srCPO.Report.HasData Then
    Me.srCPO.Visible = True
    End If
    If Me.srNOTES.Report.HasData Then
    Me.srNOTES.Visible = True
    End If
    If Me.Slmn_OutstandingCI.Report.HasData Then
    Me.Slmn_OutstandingCI.Visible = True
    End If
    If Me.SlmnOutstandingCO.Report.HasData Then
    Me.SlmnOutstandingCO.Visible = True
    End If
    End Sub

    MANY THANKS!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •