473,406 Members | 2,705 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Access Conditional Formatting Help

Access 2003
VB 6.5

I'm attempted to run conditional formatting on a date field based on the value in another field. I've steped through this code and it is recognizing the values correct and is even executing the code to set the back ground color. However when run the report I don't get any formatting.

Any help would be appreciated!


Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

On Error GoTo Detail_Format_Error


Select Case [Reports]![pm_original_scorecard_report]![def_doc_health_cd].Value
Case Is = "YL"
[Reports]![pm_original_scorecard_report]![def_doc_act_cmplt_dt].BackColor = vbYellow
Case Is = "GN"
[Reports]![pm_original_scorecard_report]![def_doc_act_cmplt_dt].BackColor = vbGreen
Case Is = "BL"
[Reports]![pm_original_scorecard_report]![def_doc_act_cmplt_dt].BackColor = vbBlue
Case Is = "RD"
[Reports]![pm_original_scorecard_report]![def_doc_act_cmplt_dt].BackColor = vbRed
Case Else
[Reports]![pm_original_scorecard_report]![def_doc_act_cmplt_dt].BackColor = vbWhite
End Select



Detail_Format_Exit:
Exit Sub

Detail_Format_Error:
MsgBox "Error " & Err.Number & ": " & Err.Description
Resume Detail_Format_Exit

End Sub
Oct 17 '08 #1
3 1829
ADezii
8,834 Expert 8TB
If you are getting the Back Colors, what exactly aren't you getting?
Oct 17 '08 #2
I wasn't getting the back colors even though I stepped through the code and it showed it executing that line.

However, we can chalk this up to a strange MicroSoft behavior because I just went in and tried the conditional formatting through the GUI. I literally just added one condition and ran the report and everything started working. I then went and removed the conditional formatting via the GUI and just kept the code ... Still works. I didn't change one piece of code ......
Oct 17 '08 #3
missinglinq
3,532 Expert 2GB
I've never had trouble using CF thru code, but when using expressions I knew were valid in CF thru the GUI I've had a number of times when it didn't work. Once I gave up to tend to other business, and returning to the form found that it worked just as it should! Since then when this happens I always close the app then re-open it and it always works. The CF appears to "hang." I've noticed that this tends to occur more frequently when I've been experimenting with different CFs on a single textbox. It'll work the first couple of tries and then bomb.

Welcome to Bytes!

Linq ;0)>
Oct 17 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Jouke Langhout | last post by:
Hello all! For quite some time now, I've got the following problem: Access won't close properly when a user closes the application. An ACCESS process stays active and that process can only be...
5
by: Richard | last post by:
Hi, I have a form that take some time to load due to many comboboxes and at least 8 subforms. When I filter or sort the main form I get an error message and then Access shuts down. They ask if...
4
by: brAccess | last post by:
I recently installed Access 2003 and immediately noticed problems with applications that work fine in 2000 and XP. I use conditional formatting on continuous forms for a number of reasons. When...
4
by: Wayne Aprato | last post by:
I have a simple database which was originally written in Access 97. When converted to Access 2000 file format it ran flawlessly in Access 2002. I've just tried to run it in Access 2003 and I am...
4
by: Bradley | last post by:
I have an A2000 database in which I have a continuous form with a tick box. There is also a text box with a conditional format that is based on the expression , if it's true then change the...
5
by: Andrew Chanter | last post by:
Does anyone know a way you can use conditional formatting to create a banded style view as is commonly seen on the internet. (In othe words the first record appears on a gray background, the 2nd...
8
by: Typehigh | last post by:
I have many text fields with conditional formatting applied, specifically when the condition is "Field Has Focus". Without any events associated with the fields the conditional formatting works...
1
by: dddsssdddsss | last post by:
A comment and a question To anyone who is using conditional formatting, beware that in Access 2007 the color pallette is not the same as the color pallette in Access 2003. So if you have a...
6
by: GAC | last post by:
I've used conditional formatting on ACCESS reports but have come up with a problem using it for a FIELD that has a value of either YES or blank/null. The default formatting (used when condition(s)...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.