Connecting Tech Pros Worldwide Forums | Help | Site Map

Conditional formatting question

Member
 
Join Date: Apr 2007
Posts: 47
#1: May 31 '07
Hi,

I have a quick question. Is there an option for conditional formatting in access 97? or is it only for access 2000 or higher? I need to change font color in access 97 report depending on the value. Thank you

ADezii's Avatar
Expert
 
Join Date: Apr 2006
Location: Philadelphia
Posts: 5,219
#2: Jun 1 '07

re: Conditional formatting question


Quote:

Originally Posted by ConfusedMay

Hi,

I have a quick question. Is there an option for conditional formatting in access 97? or is it only for access 2000 or higher? I need to change font color in access 97 report depending on the value. Thank you

Condiotional Formatting is not built in with Access 97. You would have to resort to VBA code instead.
puppydogbuddy's Avatar
Expert
 
Join Date: May 2007
Location: Florida
Posts: 1,915
#3: Jun 1 '07

re: Conditional formatting question


Here is an example of what the VBA code might look like. The background color property was used for illustrative purposes., If you wanted to change the font color, you would change the foreground color (ForeColor) property.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Quantity_AfterUpdate()
  2. Select Case CInt(Me.Quantity)
  3.         Case 0 To 10
  4.             Me.Quantity.BackColor = _
  5.                 RGB(150, 150, 200)
  6.         Case 11 To 40
  7.             Me.Quantity.BackColor = _
  8.                 RGB(75, 75, 200)
  9.         Case 41 To 160
  10.             Me.Quantity.BackColor = _
  11.                 RGB(0, 0, 255)
  12.         Case Else
  13.             Me.Quantity.BackColor = _
  14.                 RGB(200, 0, 0)
  15.     End Select
  16. End Sub 
  17.  
Member
 
Join Date: Apr 2007
Posts: 47
#4: Jun 1 '07

re: Conditional formatting question


Quote:

Originally Posted by puppydogbuddy

Here is an example of what the VBA code might look like. The background color property was used for illustrative purposes., If you wanted to change the font color, you would change the foreground color (ForeColor) property.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Quantity_AfterUpdate()
  2. Select Case CInt(Me.Quantity)
  3.         Case 0 To 10
  4.             Me.Quantity.BackColor = _
  5.                 RGB(150, 150, 200)
  6.         Case 11 To 40
  7.             Me.Quantity.BackColor = _
  8.                 RGB(75, 75, 200)
  9.         Case 41 To 160
  10.             Me.Quantity.BackColor = _
  11.                 RGB(0, 0, 255)
  12.         Case Else
  13.             Me.Quantity.BackColor = _
  14.                 RGB(200, 0, 0)
  15.     End Select
  16. End Sub 
  17.  


Thank you very much....
Reply