A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Access 97-change colour of a number in a report depending on value?



 
 
Thread Tools Display Modes
  #1  
Old May 19th, 2004, 03:58 PM
Peter
external usenet poster
 
Posts: n/a
Default Access 97-change colour of a number in a report depending on value?

Hi,
I'm using access 97 and have a basic report lising a
series of results for a number of sites. I'm wanting to
change the appearence of a number depending on what it
is...say if it's than 2000, the result is shown in red
and if below 100 in green. I understand conditional
formating is only available in access 2K but wanted to
know if there's a way? Even having a text box behind the
number and changing the colour of that would help!!
  #2  
Old May 19th, 2004, 04:08 PM
SA
external usenet poster
 
Posts: n/a
Default Access 97-change colour of a number in a report depending on value?

Peter:

Actually this is pretty easy to do. In the On Print event of the section of
the report that contains the control with the value you want to evaluate and
change the colour of, add code like this:

Const RED = 255
Const GREEN = 65280

If Me!NameOfYourControl.Value 2000 Then
Me!NameOfYourControl.ForeColor = RED
Else
Me!NameOfYourControl.ForeColor = GREEN
End If

HTH
--
Steve Arbaugh
ACG Soft
http://ourworld.compuserve.com/homepages/attac-cg

"Peter" wrote in message
...
Hi,
I'm using access 97 and have a basic report lising a
series of results for a number of sites. I'm wanting to
change the appearence of a number depending on what it
is...say if it's than 2000, the result is shown in red
and if below 100 in green. I understand conditional
formating is only available in access 2K but wanted to
know if there's a way? Even having a text box behind the
number and changing the colour of that would help!!



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:14 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.