BackColor in SubReport

L

Luis

I need to change the color on a subReport for each record that is print
(displayed, showed). I tried the code below but does not fulfill the
requirement.

If Me.Baselined = "Y" Then
Reports!NeedDateScoreCard!NeedDateScoreCardDetail!!Investigate.Visible =
False
Me.Section("Detail").backColor = vbWhite
Else
Reports!NeedDateScoreCard!NeedDateScoreCardDetail!!Investigate.Visible = True
Me.Section("Detail").backColor = vbYellow
End If

Wonder if I can use something like the code below. However, I don't know how
to make it works! Suggestions please.

Reports!NeedDateScoreCard!NeedDateScoreCardDetail!!Section(0).backColor =
vbYellow

Thank you for guidance and collaboration solving this problem.

What is does is change the total section of the subReport based on the last
record read. Is there any suggestions to overcome this problem.
 
D

Duane Hookom

You should have code in the On Format event of the section you want to color.
In addition, the fields/values you want to reference must be bound to
controls in the section. Your code assumes Baseline is a text value/field.

Try something like:

If Me.Baselined = "Y" Then
Me.Investigate.Visible = False
Me.Section("Detail").backColor = vbWhite
Else
Me.Investigate.Visible = True
Me.Section("Detail").backColor = vbYellow
End If
 
R

Rudolf Lamour

Luis said:
I need to change the color on a subReport for each record that is print
(displayed, showed). I tried the code below but does not fulfill the
requirement.

If Me.Baselined = "Y" Then
Reports!NeedDateScoreCard!NeedDateScoreCardDetail!!Investigate.Visible =
False
Me.Section("Detail").backColor = vbWhite
Else
Reports!NeedDateScoreCard!NeedDateScoreCardDetail!!Investigate.Visible =
True
Me.Section("Detail").backColor = vbYellow
End If

Wonder if I can use something like the code below. However, I don't know
how
to make it works! Suggestions please.

Reports!NeedDateScoreCard!NeedDateScoreCardDetail!!Section(0).backColor =
vbYellow

Thank you for guidance and collaboration solving this problem.

What is does is change the total section of the subReport based on the
last
record read. Is there any suggestions to overcome this problem.
 
R

Rudolf Lamour

Luis said:
I need to change the color on a subReport for each record that is print
(displayed, showed). I tried the code below but does not fulfill the
requirement.

If Me.Baselined = "Y" Then
Reports!NeedDateScoreCard!NeedDateScoreCardDetail!!Investigate.Visible =
False
Me.Section("Detail").backColor = vbWhite
Else
Reports!NeedDateScoreCard!NeedDateScoreCardDetail!!Investigate.Visible =
True
Me.Section("Detail").backColor = vbYellow
End If

Wonder if I can use something like the code below. However, I don't know
how
to make it works! Suggestions please.

Reports!NeedDateScoreCard!NeedDateScoreCardDetail!!Section(0).backColor =
vbYellow

Thank you for guidance and collaboration solving this problem.

What is does is change the total section of the subReport based on the
last
record read. Is there any suggestions to overcome this problem.
 
R

Rudolf Lamour

Luis said:
I need to change the color on a subReport for each record that is print
(displayed, showed). I tried the code below but does not fulfill the
requirement.

If Me.Baselined = "Y" Then
Reports!NeedDateScoreCard!NeedDateScoreCardDetail!!Investigate.Visible =
False
Me.Section("Detail").backColor = vbWhite
Else
Reports!NeedDateScoreCard!NeedDateScoreCardDetail!!Investigate.Visible =
True
Me.Section("Detail").backColor = vbYellow
End If

Wonder if I can use something like the code below. However, I don't know
how
to make it works! Suggestions please.

Reports!NeedDateScoreCard!NeedDateScoreCardDetail!!Section(0).backColor =
vbYellow

Thank you for guidance and collaboration solving this problem.

What is does is change the total section of the subReport based on the
last
record read. Is there any suggestions to overcome this problem.
 
R

Rudolf Lamour

Luis said:
I need to change the color on a subReport for each record that is print
(displayed, showed). I tried the code below but does not fulfill the
requirement.

If Me.Baselined = "Y" Then
Reports!NeedDateScoreCard!NeedDateScoreCardDetail!!Investigate.Visible =
False
Me.Section("Detail").backColor = vbWhite
Else
Reports!NeedDateScoreCard!NeedDateScoreCardDetail!!Investigate.Visible =
True
Me.Section("Detail").backColor = vbYellow
End If

Wonder if I can use something like the code below. However, I don't know
how
to make it works! Suggestions please.

Reports!NeedDateScoreCard!NeedDateScoreCardDetail!!Section(0).backColor =
vbYellow

Thank you for guidance and collaboration solving this problem.

What is does is change the total section of the subReport based on the
last
record read. Is there any suggestions to overcome this problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top