Color Report textbox

  • Thread starter Thread starter alex
  • Start date Start date
A

alex

Color Report textbox

Hello,

Using Access ’03…

I’m trying to build a report with a little color…

I have a key that I keep in the Page Footer of the Report. It’s
pretty simple and looks like this:
1 to 5 = poor
5.1 to 10 = fair
10.1 to 15 = average
Etc…

I use colors to delineate the various ratings; e.g., poor is blue,
fair is yellow, etc., up to 6 ratings.

In the detail section of the Report are two textboxes that calculate a
person’s rating (number and text…e.g., 8 fair) by month. I’d like to
color the textbox(s) based on the key…

I cannot use conditional formatting because I have more than 4 colors…

I’ve tried this code in the On Print Event:
If [ControlName] = “pick value” then
Me.ControlName.BackColor = pick color
End if
It will color the textbox, but the textbox won’t requery when its
value changes…remember the report is by month and several months are
reported at a time!

My options seem to be limited; not sure if someone has some insight.
Thanks
alex
 
Try putting the code in an expression in the textbox using IIF function.

Damon

Color Report textbox

Hello,

Using Access ’03…

I’m trying to build a report with a little color…

I have a key that I keep in the Page Footer of the Report. It’s
pretty simple and looks like this:
1 to 5 = poor
5.1 to 10 = fair
10.1 to 15 = average
Etc…

I use colors to delineate the various ratings; e.g., poor is blue,
fair is yellow, etc., up to 6 ratings.

In the detail section of the Report are two textboxes that calculate a
person’s rating (number and text…e.g., 8 fair) by month. I’d like to
color the textbox(s) based on the key…

I cannot use conditional formatting because I have more than 4 colors…

I’ve tried this code in the On Print Event:
If [ControlName] = “pick value” then
Me.ControlName.BackColor = pick color
End if
It will color the textbox, but the textbox won’t requery when its
value changes…remember the report is by month and several months are
reported at a time!

My options seem to be limited; not sure if someone has some insight.
Thanks
alex
 
alex,
Reports are easier to "custom" conditionally format.

Use the section's OnFormat Event to decide what color the Rating
value should be. If the rating appears in the Detail section, use the
Detail section's OnFormat event...
(aircode)
If Rating >=1 and Rating <=5 Then
Rating.Forecolor = RGB(250,0,0) 'red
Elseif Rating >5 and Rating <= 10 Then
etc... for all ratings categories...
End if
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

Color Report textbox

Hello,

Using Access ’03…

I’m trying to build a report with a little color…

I have a key that I keep in the Page Footer of the Report. It’s
pretty simple and looks like this:
1 to 5 = poor
5.1 to 10 = fair
10.1 to 15 = average
Etc…

I use colors to delineate the various ratings; e.g., poor is blue,
fair is yellow, etc., up to 6 ratings.

In the detail section of the Report are two textboxes that calculate a
person’s rating (number and text…e.g., 8 fair) by month. I’d like to
color the textbox(s) based on the key…

I cannot use conditional formatting because I have more than 4 colors…

I’ve tried this code in the On Print Event:
If [ControlName] = “pick value” then
Me.ControlName.BackColor = pick color
End if
It will color the textbox, but the textbox won’t requery when its
value changes…remember the report is by month and several months are
reported at a time!

My options seem to be limited; not sure if someone has some insight.
Thanks
alex
 
Frank Rice, a technical writing genius at Microsoft, wrote an article some
time ago that may help you:

http://msdn.microsoft.com/en-us/library/aa139965(office.10).aspx

there's also a Knowledge Base article that may help:

http://support.microsoft.com/kb/304104/en-us?spid=2509&sid=446
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


Color Report textbox

Hello,

Using Access ’03…

I’m trying to build a report with a little color…

I have a key that I keep in the Page Footer of the Report. It’s
pretty simple and looks like this:
1 to 5 = poor
5.1 to 10 = fair
10.1 to 15 = average
Etc…

I use colors to delineate the various ratings; e.g., poor is blue,
fair is yellow, etc., up to 6 ratings.

In the detail section of the Report are two textboxes that calculate a
person’s rating (number and text…e.g., 8 fair) by month. I’d like to
color the textbox(s) based on the key…

I cannot use conditional formatting because I have more than 4 colors…

I’ve tried this code in the On Print Event:
If [ControlName] = “pick value” then
Me.ControlName.BackColor = pick color
End if
It will color the textbox, but the textbox won’t requery when its
value changes…remember the report is by month and several months are
reported at a time!

My options seem to be limited; not sure if someone has some insight.
Thanks
alex
 
Frank Rice, a technical writing genius at Microsoft, wrote an article some
time ago that may help you:

http://msdn.microsoft.com/en-us/library/aa139965(office.10).aspx

there's also a Knowledge Base article that may help:

http://support.microsoft.com/kb/304104/en-us?spid=2509&sid=446
--
Arvin Meyer, MCP, MVPhttp://www.datastrat.comhttp://www.mvps.org/accesshttp://www.accessmvp.com


Color Report textbox

Hello,

Using Access ’03…

I’m trying to build a report with a little color…

I have a key that I keep in the Page Footer of the Report.  It’s
pretty simple and looks like this:
1 to 5 = poor
5.1 to 10 = fair
10.1 to 15 = average
Etc…

I use colors to delineate the various ratings; e.g., poor is blue,
fair is yellow, etc., up to 6 ratings.

In the detail section of the Report are two textboxes that calculate a
person’s rating (number and text…e.g., 8 fair) by month.  I’d like to
color the textbox(s) based on the key…

I cannot use conditional formatting because I have more than 4 colors…

I’ve tried this code in the On Print Event:
If [ControlName] = “pick value” then
Me.ControlName.BackColor = pick color
End if
It will color the textbox, but the textbox won’t requery when its
value changes…remember the report is by month and several months are
reported at a time!

My options seem to be limited; not sure if someone has some insight.
Thanks
alex

Thanks Guys for the help. Much appreciated.
Al, your code works perfectly...I was even able to set the color based
on the color of the key textbox, thus I won't have to change the code
should I decide to change the color(s).
alex
 
Damon,
...code in an expression in the textbox using IIF...
Hmmm... not sure that's possible.
An IIF calculation... as the Control Source of a text control...
can only return values, by declaration or expression.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

Damon Heron said:
Try putting the code in an expression in the textbox using IIF function.

Damon

Color Report textbox

Hello,

Using Access '03.

I'm trying to build a report with a little color.

I have a key that I keep in the Page Footer of the Report. It's
pretty simple and looks like this:
1 to 5 = poor
5.1 to 10 = fair
10.1 to 15 = average
Etc.

I use colors to delineate the various ratings; e.g., poor is blue,
fair is yellow, etc., up to 6 ratings.

In the detail section of the Report are two textboxes that calculate a
person's rating (number and text.e.g., 8 fair) by month. I'd like to
color the textbox(s) based on the key.

I cannot use conditional formatting because I have more than 4 colors.

I've tried this code in the On Print Event:
If [ControlName] = "pick value" then
Me.ControlName.BackColor = pick color
End if
It will color the textbox, but the textbox won't requery when its
value changes.remember the report is by month and several months are
reported at a time!

My options seem to be limited; not sure if someone has some insight.
Thanks
alex
 
Back
Top