Highlighting Record in a Report

  • Thread starter Thread starter RyanG
  • Start date Start date
R

RyanG

Hello All,

I've got a report design here that i need to do a little
work with. I need to be able to have the report
automatically "highlight" the records which contain a
negative value in a calculated field. So anyway i have a
text box called TextBox23 which contains this formula..

=Format(([ytd]-[lytd])/[lytd],"0%"

Easy enough, but i need to have a yellow rectangle or box
behind the records that toggles visibility depending on if
the value in TextBox23 is negative or not.

Any help is greatly appreciated,

- RJ
 
I got this from one of the MVP's(ofcourse). Try this, in
the detail format section of the report. Make sure that
the section's background color and textboxes are
transparent

If fieldname < 0 Then
Me.Section(0).BackColor = 12632256 ' gray
Else
Me.Section(0).BackColor = vbWhite
End If
 
Hi Jim,

How do i make the section's BG transparent? I tried just
deleting the color code from the properties box but it
won't allow me to proceed without something there.. The
code doesn't seem to be working more - more then likely
because of this.

Thanks for your help,

- RJ
-----Original Message-----
I got this from one of the MVP's(ofcourse). Try this, in
the detail format section of the report. Make sure that
the section's background color and textboxes are
transparent

If fieldname < 0 Then
Me.Section(0).BackColor = 12632256 ' gray
Else
Me.Section(0).BackColor = vbWhite
End If
-----Original Message-----
Hello All,

I've got a report design here that i need to do a little
work with. I need to be able to have the report
automatically "highlight" the records which contain a
negative value in a calculated field. So anyway i have a
text box called TextBox23 which contains this formula..

=Format(([ytd]-[lytd])/[lytd],"0%"

Easy enough, but i need to have a yellow rectangle or box
behind the records that toggles visibility depending on if
the value in TextBox23 is negative or not.

Any help is greatly appreciated,

- RJ
.
.
 
Hey Jim,

It appears to work fine if i remove the format portion of
the cell that's being calculated - here's the formula
that's in the cell that's being calculated...

=IIf([lytd]=0 Or IsNull([lytd]),"",Format(([ytd]-[lytd])/
[lytd],"0%"))

I need this to display box to show a percentage otherwise
the function you provided would work. Anyone know a work-
around for this?

Thanks,

- RJ
-----Original Message-----
Hi Jim,

How do i make the section's BG transparent? I tried just
deleting the color code from the properties box but it
won't allow me to proceed without something there.. The
code doesn't seem to be working more - more then likely
because of this.

Thanks for your help,

- RJ
-----Original Message-----
I got this from one of the MVP's(ofcourse). Try this, in
the detail format section of the report. Make sure that
the section's background color and textboxes are
transparent

If fieldname < 0 Then
Me.Section(0).BackColor = 12632256 ' gray
Else
Me.Section(0).BackColor = vbWhite
End If
-----Original Message-----
Hello All,

I've got a report design here that i need to do a little
work with. I need to be able to have the report
automatically "highlight" the records which contain a
negative value in a calculated field. So anyway i have a
text box called TextBox23 which contains this formula..

=Format(([ytd]-[lytd])/[lytd],"0%"

Easy enough, but i need to have a yellow rectangle or box
behind the records that toggles visibility depending on if
the value in TextBox23 is negative or not.

Any help is greatly appreciated,

- RJ
.
.
.
 
Click on the background, off any control in the detail
section. On the formatting form/report toolbar click the
icon(the one that looks like a paint bucket and select
transparent.

For the code
right click on the details header and select properties
in the "On Format" add an Event Procedure.
Add the code

Jim
-----Original Message-----
Hi Jim,

How do i make the section's BG transparent? I tried just
deleting the color code from the properties box but it
won't allow me to proceed without something there.. The
code doesn't seem to be working more - more then likely
because of this.

Thanks for your help,

- RJ
-----Original Message-----
I got this from one of the MVP's(ofcourse). Try this, in
the detail format section of the report. Make sure that
the section's background color and textboxes are
transparent

If fieldname < 0 Then
Me.Section(0).BackColor = 12632256 ' gray
Else
Me.Section(0).BackColor = vbWhite
End If
-----Original Message-----
Hello All,

I've got a report design here that i need to do a little
work with. I need to be able to have the report
automatically "highlight" the records which contain a
negative value in a calculated field. So anyway i have a
text box called TextBox23 which contains this formula..

=Format(([ytd]-[lytd])/[lytd],"0%"

Easy enough, but i need to have a yellow rectangle or box
behind the records that toggles visibility depending on if
the value in TextBox23 is negative or not.

Any help is greatly appreciated,

- RJ
.
.
.
 
Back
Top