Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Jan 2008
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I've created a report with alternating bands. No problem there - I've had this report running well for awhile. The customer would now like a subreport included that will have anywhere from one to multiple line items for each of the lines in the main report. The subreport is located at the far right of the report within the detail band. It takes up one line only, but can expand as needed to multiple lines. The issue now is that the subreport shows up white when the bands are grey. I tried to add the same logic to the detail.backcolor of the subreport in the Detail_Print event, and it works well until there are two lines in the subreport and only one line in the main report. When this happens, I see alternating lines for the subreport section of the report while the main report has just one color for that item. It looks horrible. Is there any way I can get the subreport to sync up with the report? I tried to check for the backcolor of the report by checking If Reports!ReportName.Detail.Backcolor = vbWhite, for example, within the Detail_Print event of the subreport, but Access seems to think it's ALWAYS white - it never reports it being grey. I also checked for the Detail.Height being greater than zero, but again, Access always reports the height as zero even if it is, in fact, much higher because of the multiple items. I'm at a loss as to what to do and still keep all this information within the detail band. I could create a separate band, but that would make the report horribly long - it's already several hundred pages long.

    Any help would be most appreciated.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Put code like this in the On Format event of the Detail section of the subreport:

    Code:
    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
      Me.Detail.BackColor = Me.Parent.Detail.BackColor
    End Sub

  3. #3
    Star Lounger
    Join Date
    Jan 2008
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by HansV View Post
    Put code like this in the On Format event of the Detail section of the subreport:

    Code:
    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
      Me.Detail.BackColor = Me.Parent.Detail.BackColor
    End Sub
    That's got it! Knew I could count on you, Hans!

Posting Permissions

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