473,549 Members | 2,346 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Access Conditional Formatting Help

2 New Member
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(C ancel As Integer, FormatCount As Integer)

On Error GoTo Detail_Format_E rror


Select Case [Reports]![pm_original_sco recard_report]![def_doc_health_ cd].Value
Case Is = "YL"
[Reports]![pm_original_sco recard_report]![def_doc_act_cmp lt_dt].BackColor = vbYellow
Case Is = "GN"
[Reports]![pm_original_sco recard_report]![def_doc_act_cmp lt_dt].BackColor = vbGreen
Case Is = "BL"
[Reports]![pm_original_sco recard_report]![def_doc_act_cmp lt_dt].BackColor = vbBlue
Case Is = "RD"
[Reports]![pm_original_sco recard_report]![def_doc_act_cmp lt_dt].BackColor = vbRed
Case Else
[Reports]![pm_original_sco recard_report]![def_doc_act_cmp lt_dt].BackColor = vbWhite
End Select



Detail_Format_E xit:
Exit Sub

Detail_Format_E rror:
MsgBox "Error " & Err.Number & ": " & Err.Description
Resume Detail_Format_E xit

End Sub
Oct 17 '08 #1
3 1844
ADezii
8,834 Recognized Expert Expert
If you are getting the Back Colors, what exactly aren't you getting?
Oct 17 '08 #2
summerlw
2 New Member
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 Recognized Expert Specialist
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
5921
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 terminated by pressing ++ and then terminate the process. I searched the entire internet and found out that there could be two things wrong (both...
5
3069
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 I want to send the error report to Microsoft. Has anybody seen this type of error message and what can I do to prevent it from happening. Am I doing...
4
6869
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 these forms are opened in 2003, Access seems to go into a continuous loop. Has anyone else experienced this problem? Does anyone know of a solution...
4
2121
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 seeing the following behaviour: Some of the fields on the continuous main form which is a list of jobs with their related details "flicker". While...
4
3123
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 background colour. In A2000 it works great, but in A2003 the background doesn't always change and when it does it only changes when the record looses...
5
8949
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 on white, the third on gray etc etc.) I could write an expression based on the odd/even status of the primary key but this wont work when sorting...
8
8470
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 perfectly. However, I have code that runs under the ON CLICK event. The code changes the focus to other controls, which means the conditional...
1
4212
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 particular color you were using as a standard throughout your application, the only way to continue using that color is to code the color. Anyone...
6
3639
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) are not met) is always used EVEN WHEN I specify Condition 1 to change the formatting when the field is YES. What am I missing....doesn't...
0
7546
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7471
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7740
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7503
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5111
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3517
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1962
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1082
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
784
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.