Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conditional Formatting 1

Status
Not open for further replies.

jdclark59

Programmer
Mar 27, 2005
7
0
0
US
How can I add more than three conditions to a field?
I have a field that can have 7 different values. I would like to show a different color for each of the values. The Conditional Formatting dialogue only allows three conditions.

Jack
 
Report=Yes , Form=Maybe?!(probably no)

________________________________________
Zameer Abdulla
Visit Me
Hold your child's hand every chance you get.
A time will come when he or she won't let you.
 
can you not edit the conditional formatting with code, and add it in that way?

although I'm not at all sure how to do this...

--------------------
Procrastinate Now!
 
With or without code - only four conditions, if you count the "non condition" thinigie.

Here's how one did it in a97 Colors and Continuous forms. I've never tried it, but it's supposed to work.

For a single form (not continuous), you can alter the backcolor programatically with as many conditions you like.

Roy-Vidar
 
See this will work in reports and not in forms!!
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Select Case Me.SubCategory.Value
Case "Soft Drinks"
    Me.SubCategory.FontBold = True
    Me.SubCategory.FontSize = 12
    Me.SubCategory.FontName = "Verdana"
    
Case "Chemical"
    Me.SubCategory.ForeColor = vbBlue
    Me.SubCategory.FontSize = 10
    Me.SubCategory.FontName = "Arial"
    
Case "General"
    Me.SubCategory.ForeColor = vbRed
    Me.SubCategory.FontSize = 11
    Me.SubCategory.FontName = "Times New Roman"
 
Case "Tea / Coffee"
    Me.SubCategory.ForeColor = vbGreen
    Me.SubCategory.FontSize = 8
    
Case Else
    Me.SubCategory.ForeColor = vbBlack
    Me.SubCategory.FontSize = 9
    Me.SubCategory.FontName = "Verdana"
    
End Select
End Sub

________________________________________
Zameer Abdulla
Visit Me
Hold your child's hand every chance you get.
A time will come when he or she won't let you.
 
I suppose you will just have to use code to change the background values based on the entry in the field...

--------------------
Procrastinate Now!
 
You can change the backgorund, but it will change the entire column, not a single cell(field) in a row.

________________________________________
Zameer Abdulla
Visit Me
Hold your child's hand every chance you get.
A time will come when he or she won't let you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top