473,659 Members | 2,685 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ForeColor & BackColor Using Date Field

1 New Member
Hi,

I have set up a report In Access 2003 where there are 2 check boxes I refer to to change the color of the Date of that record. That part is working.

I also need to Change the color of the date feild when the date in the field is 3 days or more older. I am currently using the following code.

Any Suggestions?
Thanks In Advance,
Ray

Expand|Select|Wrap|Line Numbers
  1. Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
  2. Dim lngBlack As Long
  3. Dim lngRed As Long, lngGreen As Long, lngWhite As Long, lngYellow As Long
  4.     lngRed = RGB(255, 0, 0)
  5.     lngBlack = RGB(0, 0, 0)
  6.     lngGreen = RGB(60, 116, 44)
  7.     lngWhite = RGB(255, 255, 255)
  8.     lngYellow = RGB(255, 255, 0)
  9.  
  10.  If Check65 = -1 Then
  11.      Me!Date.ForeColor = lngWhite
  12.      Me!Date.BackColor = lngGreen
  13.      Else
  14.      Me!Date.ForeColor = lngBlack
  15.      Me!Date.BackColor = lngWhite
  16.  
  17.  If Check49 = -1 Then
  18.      Me!Date.ForeColor = lngBlack
  19.      Me!Date.BackColor = lngYellow
  20.         Else
  21.      Me!Date.ForeColor = lngBlack
  22.      Me!Date.BackColor = lngWhite
  23.  
  24. If Me.[Date Evaluated].Value = Now() + 3 Then
  25.      Me!Date.ForeColor = lngBlack
  26.      Me!Date.BackColor = lngRed
  27.         Else
  28.      Me!Date.ForeColor = lngBlack
  29.      Me!Date.BackColor = lngWhite
  30.  
  31.     End If
  32.     End If
  33.     End If
  34.  End Sub 
Mar 22 '07 #1
0 1262

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

Similar topics

1
1679
by: Christa Waggett | last post by:
Hi, I'm not a programmer but would appreciate some help with the following. I've been looking at various sites but cannot find the information I require. I have a table of strata plans and if we no longer manage the plan the date this occurs gets entered into a field. What I would like to happen is for all the fields in that record to change their forecolor to red as soon as the DateLost field is no longer null. I also have several...
9
2687
by: Max Weebler | last post by:
Hi, I have a datagrid built that has an alternating item style that sets the backcolor and ForeColor of its rows. I have 4 template columns. One of them has a LinkButton embedded in it to perform updates. All the styles that are set are being followed by all templated columns with the exception for the update column. The update column does set the BackColor appropriately but when setting its ForeColor the LinkButton's color is blue and...
9
3474
by: Jim | last post by:
Hi folks! I'm new to this forum. I've programmed in VB starting w/VB1 about 9 years ago! ;) Certainly most time spent in VB6. Now trying to make the leap to VB.NET. Much harder than I thought it would be. For now, I need to know how to change the foreground and background colors on labels and buttons. I used to be able to do this in VB6 but cannot seem to get it to work in VB.NET. Any suggestions will be greatly appreciated!
4
5097
by: Stephen | last post by:
greeting folks I would like to change the foreground color for a disabled textbox from the dimmed gray to something else that is easlier readable. I can change the background using the following: textbox1.BackColor = System.Drawing.SystemColors.Control.White however i cant for the life of me figure out the foreground . any help would be appreciated
3
9012
by: Eric Moreau | last post by:
Hi I have a user that is visually impaired and who cannot read textboxes content when they are disabled. I have tried to inherits from the Textbox and overwrite the Paint method but I have not been able to get a a perfect textbox. SO what I need is a textbox on which I have the control of the BackColor and the ForeColor when Disabled.
1
3858
by: John_H | last post by:
Re: ASP.NET 2.0 I would like suggestions or code examples on how to collect a variable length list of input data (item# & item quantity specifically). I thought that I could accomplish this using a GridView that has ViewState enabled, an ObjectDataSource to process the submitted list, textboxes for getting new item data and an add button. Does this approach sound feasible or are there better alternatives? My problem is that I don't...
0
1541
by: Seok Bee | last post by:
Dear Experts, I am having a wizard control in my web app. I have some textbox controls within the wizard control. At the same time, I have a hyperlink to run a pop-up window for calendar. The pop-up window is executed by calling a javascript function. However, when I click on the calendar link for the pop-up, I received an error message stating : Microsoft JScript runtime error: Object required When I use the same script in another...
4
1815
by: Bob | last post by:
Hi, When clicked into any cell of the table, i want to get the background color of it. I can get the forecolor but not the bakground color (gives an empty Alert, no error). I think i can't change anything in the code-behind, so the error will be in the javascript code ... Thanks for your help Bob
2
2214
by: Bill Stillwell | last post by:
I am trying to set the "backcolor" property in fields in a form. It sets okay using a macro (setvalue). But when I close the form, the property settings revert back to what they were before I closed the form. So when I reopen the form, the settings are not changed. If I manually change the settings while not in Design mode (using the "fill with" icon), the settings hold. If I change the settings while in Design mode, the settings do not...
0
8427
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8330
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8850
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
7355
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6178
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4334
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2749
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
2
1975
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1737
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.