Results 1 to 6 of 6
  1. #1
    Grave is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Aug 2012
    Location
    Osan AB, South Korea
    Posts
    7

    Need Help Conditional Formatting a Text Box by Calendar Month

    Hi,

    I have a database that tracks inspection due dates on industrial equipment. What I want to do is conditonally format the text boxes, so that any inspection that comes due on the next calendar month is highlighted green. For example:

    Today is 21-Aug-2012. If a piece of equipment has an inspection due in September, I want the text box displaying the inspection date to be highlighted green.




    Any help would be appreciated, thanks!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    So the criteria would be if the due date is any day in the next month? So if today is August 1 only the due dates in September will display green? Don't want the Aug 2 to 31 due dates to display green?

    Month(Date()) + 1 = Month([DueDate])
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Grave is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Aug 2012
    Location
    Osan AB, South Korea
    Posts
    7
    June, that would be correct. I already have the current month (for our example, this month is August) conditionally formatted to highlight yellow, by using this formula: Month([DueDate])=Month(Date())


    I just couldn't figure out how to add a month to it. It's a little different than Excel (which I'm more familiar with). But, your formula did the trick. Thank you!

  4. #4
    Grave is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Aug 2012
    Location
    Osan AB, South Korea
    Posts
    7
    Ok, I just noticed something. Using June7's formula above, any inspection date that is due in September (regardless of year) is now being highlighted in green. For example: Inspection dates for equipment due in September 2012 and September 2013 are now being highlighted green. All I need is for the next calendar month (September 2012).

    I know I need to input a year into the formula somewhere, but how?

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Try:

    Format([DueDate],"myyyy")=Format(Date(),"myyyy")

    Format([DueDate],"myyyy")=Format(DateAdd("m",1,Date()),"myyyy")
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    Grave is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Aug 2012
    Location
    Osan AB, South Korea
    Posts
    7
    Yes, that did the trick! Now next year's dates are back to the default formatting. Thanks again!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 04-26-2012, 08:31 PM
  2. Conditional Formatting of Text Boxes
    By beribimba in forum Reports
    Replies: 2
    Last Post: 03-09-2012, 05:08 PM
  3. Conditional Formatting
    By ccordner in forum Reports
    Replies: 6
    Last Post: 01-09-2012, 04:12 PM
  4. conditional formatting right(..)
    By bbeernaert in forum Access
    Replies: 3
    Last Post: 08-25-2010, 12:33 AM
  5. Replies: 0
    Last Post: 11-13-2009, 10:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums