Change text based on date

I want to change the text color on a report using the attached code but can't
get it to wor not sure where I'm going wrong
txtOrderDueDate is a long date? 12/08/2009
 
Private Sub Report_Load()
If Me.txtOrderDueDate.Value <= Date + 2 Then
Me.txtOrderDueDate.ForeColor = RGB(255, 0, 0)
Else
Me.txtOrderDueDate.ForeColor = RGB(0, 255, 0)
End If
End Sub
Thanks!
Jerry

-- 
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-reports/200912/1

0
jbair
12/7/2009 9:19:53 PM
access.reports 4434 articles. 0 followers. Follow

2 Replies
1097 Views

Similar Articles

[PageSpeed] 27

jbair via AccessMonster.com wrote:

>I want to change the text color on a report using the attached code but can't
>get it to wor not sure where I'm going wrong
>txtOrderDueDate is a long date? 12/08/2009
> 
>Private Sub Report_Load()
>If Me.txtOrderDueDate.Value <= Date + 2 Then
>Me.txtOrderDueDate.ForeColor = RGB(255, 0, 0)
>Else
>Me.txtOrderDueDate.ForeColor = RGB(0, 255, 0)
>End If
>End Sub


A Report's Load event is not used for Preview or Normal
views (I think it's only for web reports).  Instead use the
Format or Print event of the section containing the
txtOrderDueDate text box.  Alternatively, you could use
COnditional Formatting.

-- 
Marsh
MVP [MS Access]
0
Marshall
12/7/2009 10:48:17 PM
Thanks Marshall works great now!

Marshall Barton wrote:
>>I want to change the text color on a report using the attached code but can't
>>get it to wor not sure where I'm going wrong
>[quoted text clipped - 7 lines]
>>End If
>>End Sub
>
>A Report's Load event is not used for Preview or Normal
>views (I think it's only for web reports).  Instead use the
>Format or Print event of the section containing the
>txtOrderDueDate text box.  Alternatively, you could use
>COnditional Formatting.
>

-- 
Message posted via http://www.accessmonster.com

0
jbair
12/9/2009 9:23:24 PM
Reply:

Similar Artilces:

Retaining rich text formatting for incoming messages
1. How can I switch back to the old Google Groups interface? The new one is a kill on the CPU. 2. In Microsoft Outlook 2000, I want my incoming messages to retain the rich text formatting that was applied by the sender. I've searched every nook in my client and can't find anything. There's mail format rules for outgoing email, replies and forwards, there's stationary, there's formatting for the Outlook interface itself (for e.g gridlines, fonts for unread items etc.) but nothing for incoming mail. What am I missing? 1) Off-topic here. This newsgroup is hosted by Microsof...

excel based budgeting #2
I amusing Excel Based Budgeting, the spreadsheet is getting created, yet created blank. I know the system created the spreadhseet b/c the worksheet page 1 gets named the Budget ID that we started with. this workstation/user can export with no issue from smart list At the same time we are working on exporting the budget, on another workstaion we were processing a pretty big GL integration any ideas? ...

Something keeps changing mail settings
In accounts, properties, servers My incoming POP3 mail server setting and account name setting are unstable. Soemthing keeps changing them. The incoming mail server is being changed to "localhost" and the account name keeps being changed to have my e-mail address appended onto the end of it. Very vexing and frustrating matter. Running Outlook 2000 (9.0.0.2711) and Outlook Express 5 (5.00.2615.200) Running five machines in peer to peer home network. This is happ[enbijg to th4e two machiunes that use OPutlook and Outlook Express as mail, managers. Anybody seen or heard...

If then between two dates
I am trying to distribute revenue evenly between two dates. I have in one cell the beginning of the project. I have in another cell the end of the project. One my spreadsheet, I am referencing the month to determine if it falls betwen the project dates. I thought it was an if(and statement but it doesn't return the answer. Any suggestions would be greatly appreciated. Try this... A1 = project start date B1 = project end date D1 = some date To test whether the date in D1 falls within the start and end dates (inclusive) for the project: =IF(AND(A1<=D1,B1>=D...

Replacating successive dates a week at a time?
My work week starts on Tuesday. I would like to have my worksheet show column A-1 row starting with the date 05/25/04, the A-2 cell immediately below it 06/01/04 and so on. Can I replicate this with out having to type the date for each successive Tuesday through the year? With appreciation Jerry (newbie to Excel) Hi Jerry, Assuming, A1=05/25/04 Put this formula in A2 and copy it down as far as you need to: =A1+7 Hope this helps! In article <unNAalPREHA.3528@TK2MSFTNGP09.phx.gbl>, "JER" <jer@home> wrote: > My work week starts on Tuesday. I would like to h...

Auto change in Encoding
This is part of the application that reads XML from file (that has UTF-8) into an XmlTextReader XmlTextReader myXmlReader = new XmlTextReader(args[0]); It then instantiates an object/class instance Render where this constructor gets called with "that" XmlReader. public Render(XmlReader cleanxmldoc) { XmlDocument XmlDoc = new XmlDocument(); System.IO.StringWriter sw = new System.IO.StringWriter(); /* sw.Encoding.Equals(System.Text.Encoding.UTF8); string dd = sw.Encoding.GetEncoder().ToString(); Console.WriteLine(dd); sw.Encoding.EncodingName.Equals("UTF8"); sw.Encodi...

Trying to change floor plan units to millimeters but does not work
Hi, I want to create a floor plan with millimeters as base unit. I created a new page with the floor plan shape and changed the unit to millimeters in the page properties. However, when I drag a wall to the page, it shows it's length in feet and inches. I can specify the length of the wall in millmeters but it still displays the result in feet and inches. Does anyone have a clue how I can change that? Thanks and regards, Robert Well, I have both Metric and US Unit stencils. I created a Metric Floor Plan, which defaults to millimeters. I changed the Measurement Units to...

track changes window is too big...can't select "okay" or "apply"
I can't scroll down and window is already moved to the top of the screen? Does anyone know what I can do? I can't think what you mean by "track changes window"? Do you maybe have your changes in a panel instead of underlines & strikeouts within the text? Version of Word? On Jan 20, 12:07=A0pm, gg <g...@discussions.microsoft.com> wrote: > I can't scroll down and window is already moved to the top of the screen?= =A0 > Does anyone know what I can do? ...

Returning text value instead of number
The following query IIf([Subject]="holidays",[SumOfNon Chargeable],"0") provides the value of the non chargeable field which originates as a number. The query returns the correct value but returns it as text and not a number, how can I rectify this? Help please... Omit the quotes around the zero: IIf([Subject]="holidays", [SumOfNon Chargeable], 0) Access sees the quotes, and assumes that it is Text. If that doesn't fix it, you need to dig deeper into how [SumOfNon Chargeable] is generated. -- Allen Browne - Microsoft MVP. Perth, Western Austra...

Outlook crashes when changing folder to view
Background: Ex2000 server being replaced with Ex2003. Users moved to new server (in the same site) while the old one still exists. .. After that serveral clients - both Outlook 2002 and 2003 - crash when changing focus from one folder to another. /ResetFolders seemed to help on some cases, in most cases not. And an other problem: on several clients Deleted Items folder has lost its Empty Deleted Items menu item. Any idea how to fix these? Recreating Outlook profile seems to be the best medicine, but causes lot of work; signatures, .PST files, additional mailboxes etc. Thanks for your he...

Font Size Changes when Hitting <Enter> Key
I have been scratching my head about this one for some time. I've looked all over the place and cannot find a solution. I have my default font as Calibri 11. I type, copy/paste from web pages, etc. Nothing special. When I hit <Enter>, the font size stays the same, Calibri 11. Then, and I'm not sure how it starts, but then I hit <Enter> and the font size changes to Calibri 9. When it starts, it keeps happening for all editing in that section of text. If there are two paragraphs of text in a bulleted list, one can have the issue and the other can be fine. It...

Greyed out fields based on pickbox
Is there a way to have a field on a form either be greyed out or not based on the selection from a pickbox. Basically what I want to do is have a pickbox and a datebox. If the pickbox value is a certain value which needs to have a date applied to it then the datebox becomes active. If the pickbox value is not one with a date attached then the datebox stays greyed out. This seems like it would be something that people would want to do so Im sure you can customize it that way. It can be done with client side scripting (JScript). Take a look to CRM's SDK. -- Marco Amoedo Plain Conc...

Can we change cell color programatically?
Hi all I'm using Excel 2003. Does Excel allow me to change the fill-color of a cell based upon the contents of that cell? For example: If the formula of a cell calculates its value to be less then, say, 100, I'd like to fill-color that cell to Green. Otherwise I'd like to color that cell with no color. Is this possible? Thanks -Mike Take a look at Format|Conditional formatting. You can specify up to 3 rules (and formats) as well as the "normal" format. Mike wrote: > > Hi all > > I'm using Excel 2003. > Does Excel allow me to change the fill...

Problem changing chartype using Chartwizard in VB Express
Hi, I am trying to create a line graph using a Microsoft VB Express module. I can get the grpah to appear with labels etc however I cannot change the chart type to line(or any other type). Below is the segment of code I have to display the graph: With oBook.ActiveSheet.ChartObjects.Add _ (Left:=100, Width:=375, Top:=75, Height:=225) .Chart.ChartWizard(Source:=oBook.ActiveSheet.Range("C4:C10"), Gallery:=xlLine, Title:="TEST", _ ValueTitle:="# of trans", CategoryTitle:="tps") End With The error...

changing minumumScale and maximumScale of an axis
hi everyone, i have a problem about setting the minumumScale of an axis when axis' source data has a date format . When source data is number formatted , there is no problem , but with date format there is a big problem . Any idea ? the row beginning with eksen.MinumumScale gives an error here is my javascript code : eksen = chart.Axes.Item(1) eksen.HasTitle = 1 eksen.AxisTitle.Text = axis1; eksen.TickLabels.Orientation = 90; eksen.MinumumScale = xmlDoc.selectSingleNode("//EXCEL_START_VALUE").text //xmlDoc.selectSingleNode("//EXCEL_START_VALUE").text : (st...

Excel Comments boxes change size
In a data sheet I have used comments boxes to illustrate my subjects, with a photo as the 'fill colour'. The trouble is although I have set the 'Size', 'scale' to 'Lock Aspect Ratio' and Properties to 'move but don't size with cells' - The comments boxes keep changing not only size but aspect ratio as well - this negates the whole point of putting in the photos. How can I overcome this? thanks Mick ...

Help with text function
I need a function to help return the first name of a text sting that contains last name,first name, midlle initial. For instance for "Walker,Catrina L" I need to return "Catrina" Terrence Are you absolutely, positively certain that EVERY text string contains the sequence LastName, FirstName MiddleInitial? Cher, for example, ... .... or Jean Claude van Damm .... or Billy Bob Thorton If you can, without question, state that every text string has a single comma in it, placed between the LastName and FirstName (hmmm, what about John Doe, Jr. ... ...

Insert data based on match
i need to search for an occurence and when found insert a comment in the next column. i.e. So when EW is found in column A the letters EW will be written into Column B Col A Col B Int EW Med EW Adv BC Any hints or help would be gratefully appreciated would a lookup table and using VLOOKUP() function be any good -- Brian ----------------------------------------------------------------------- BrianB's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=5 View this thread: http://www.excelforum.com/showthread.php?threadid=27037 ...

Add Actual End Date to Resolved Cases view
Hi We would like to add the actual end date to the Case General Tab or possibly to the Resolved Cases and/or My Resolved Cases view. I know that the Actual End Date is available on the Service Activity and Case Resolution but this field is not available for the Case. Any workaround for this? Thanks Mark ...

Expanding Text
Is there any way to have the text overprint more than one line? For example, Excel typed in cell c5 with an 18pt type will cut off the top half of all letters unless the row height is increased. Is it possible to have the text expand into C4 as opposed to increasing the height of the row? Paul Dulong It can extend into d5 if nothing else is there -- Don Guillett SalesAid Software donaldb@281.com "Paul Dulong" <pdulong@cogeco.ca> wrote in message news:imVLd.2555$Sx6.2...

SBS 2008 change company name on internal web sites
When setting up SBS I spelled my company name wrong. So now when I log in to remote.mycompany.com the name next to the little computer icon and the name in the browser header are wrong. I understand that this is trivial. I want to fix it anyway. I can't find where to do this. Can anyone help? Check to see if this registry location reflects the misspelling. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\RegisteredOrganization If it does, correct it there. "Dave the Clueless" <dave@atrbiotech.com> wrote in message news:6eae0898-e7fc-474...

Changing default paths to templates, toolbars, etc., in O2K? #2
I'm in a bind at the office. I'm constantly replacing a colleague now and I have to be at her desk. It's been a pain not to have access to my system so yesterday re-routed files so that my general and default templates and toolbar files for, say, Word and Excel are on the network. Now when I log on even at her station, I have mostly everything working exactly as if I were at my own computer. However, haven't figured out how to deal with Outlook defaults and template files (along with rwz files and all those other files we back up). Is there a way to have O2K look to a netw...

SNMP host got changed somehow
Somehow, my "Allow snmp packets from these hosts" got changed to an incorrect IP address. As far as I know, the only way this can get changed is by editing this key: HKEY_LOCAL_MACHINE\SOFTWARE\Policies\SNMP\Parameters\PermittedManagers However, the only people with access to our domain controllers were not on the systems at the time this happened. We quickly resolved matters by changing the value to the correct IP and restarting SNMP. I'm just trying to find out if anyone else has had this problem? Could Windows Updates somehow mess with this? Hello tdnnash25, ...

Auto Text
I have backed up Word data onto laptop and my "normal" template in the "shared applications" under "templates" and cannot access my custom auto text entries. If I open "Normal," the auto text entries are there. If I then open a document already started, only the standard auto text entries are there and I cannot access my custom auto text entries. AutoText entries are style-dependent, so only show up if the cursor is in the style that matches the entry. AutoText entries are saved in templates. If your custom entries are not saved in the Normal t...

Publisher shuts down when changing printers
I am running Publisher 2003 on Windows XP Pro. With a document open, I can print to the default printer just fine. However when I try to send the document to another printer, I get "Microsoft Office Publisher has encountered a problem and needs to close." All printers are networked...no local printers. I've uninstalled Publisher (actually the whole Office 2003 suite) and reinstalled. Same problem. Any ideas?? JT You experience unexpected exit when you try to print in Publisher 2003 http://support.microsoft.com/kb/837320/en-us -- Mary Sauer MSFT MVP http://office.mi...