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. |
|
|
Thread Tools | Display Modes |
#31
|
|||
|
|||
Conditional Formatting with more then 3 conditions
i have entered the following code in the OnFormatEvent of the Detail section: Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) Select Case Me.category Case "A" Me.client.BackColor = 12632256 Case "B" Me.client.BackColor = 12632256 Case "C" Me.client.BackColor = 12632256 Case Else Me.client.BackColor = 16777215 End Select Select Case Me.category Case "dat" Me.client.FontUnderline = yes Case Else Me.client.FontUnderline = no End Select End Sub but i get the formatting only with the back color, not with the font underline. have i done something wrong with the code? Ο χρήστης "Wayne Morgan" *γγραψε: Yes, in the Format event of the section of the report that the field is reported in, you could set the formatting of the control for that field. A Select Case statement may be the easiest. Example: Select Case Me.txtMyTextbox Case "AB" Me.txtMyTextbox.ForeColor = 8454143 Case 'etc Case Else Me.txtMyTextbox.ForeColor = 0 End Select -- Wayne Morgan MS Access MVP "Tim" wrote in message ... ACCESS 2000 There is a field in my database that requires highlighting; however, I have a total of 15 cases that requires, obviously I can't set that up with the default C.F. Is there a way to set up a VBA code that would allow me to set up the 15 conditions? |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
conditional formatting in form slows down calculations | Susan | Using Forms | 5 | June 13th, 2005 11:24 AM |
Conditional Formatting Error | ddate | Worksheet Functions | 0 | May 5th, 2005 09:00 PM |
Conditional Formatting Anomaly | Rutgers_Excels | General Discussion | 1 | November 1st, 2004 08:43 PM |
Freezing Conditional Formatting | Ashish Chamaria | Worksheet Functions | 3 | December 19th, 2003 10:54 AM |
Conditional formatting with formula | Ann Scharpf | Worksheet Functions | 5 | October 21st, 2003 04:29 AM |