469,601 Members | 2,039 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,601 developers. It's quick & easy.

Transparent Background on Subform

Hello,

I have a report with 2 subreports in the detail section. I have just
changed the report so that if a "Ready" checkbox is checked yes, the
background color of the detail section of the main report changes to
green. I used the following code in the main report format of the
detail section:

If [Ready] = True Then
Section(0).BackColor = vbGreen
Else
Section(0).BackColor = vbWhite
End If

End Sub

This works great, but the background color of my subreports is still
white while the rest of the detail section is green. Is there a way to
make the background color of the subreports transparent so the green
shows through? If not, is there a way to set the background color on
the subreports to the same color as the main report based on the
checkbox condition? Any help would be appreciated.

Thank You,

Chad

Nov 13 '05 #1
3 10528
sh***********************@yahoo.com wrote:
Hello,

I have a report with 2 subreports in the detail section. I have just
changed the report so that if a "Ready" checkbox is checked yes, the
background color of the detail section of the main report changes to
green. I used the following code in the main report format of the
detail section:

If [Ready] = True Then
Section(0).BackColor = vbGreen
Else
Section(0).BackColor = vbWhite
End If

End Sub

This works great, but the background color of my subreports is still
white while the rest of the detail section is green. Is there a way to
make the background color of the subreports transparent so the green
shows through? If not, is there a way to set the background color on
the subreports to the same color as the main report based on the
checkbox condition? Any help would be appreciated.

Thank You,

Chad

I'm just guessing but you probably have to set the background color of
your subreport to a color also. Change SubReportName to your sub report
name and see if that works.

If [Ready] Then
Section(0).BackColor = vbGreen
me.SubReportName.Report.Section(0).BackColor = vbGreen
Else
Section(0).BackColor = vbWhite
me.SubReportName.Report.Section(0).BackColor = vbWHite
End If
Nov 13 '05 #2
Go into Design view on both reports
Right click on the background of the parent report and copy the 'Back
Color' property
Right click on the background of the child report and paste into the
'Back Color' property
Or a variaton on what salad was telling you
In the subreport . . .
Private Sub Form_Load()
On error resume next
Me.Detail.BackColor=Me.Parent.Detail.BackColor
End Sub
HTH
Pachydermitis

Nov 13 '05 #3
That worked perfectly. Thanks for the help.

Chad

Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Grahammer | last post: by
4 posts views Thread by Vincent | last post: by
2 posts views Thread by Trond Michelsen | last post: by
reply views Thread by Martijn Mulder | last post: by
11 posts views Thread by vbt | last post: by
8 posts views Thread by salmobytes | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.