Conditional formatting Datasheet subform

Posted on 2009-02-17
Last Modified: 2013-11-28
I have set 3 criteria using the conditional formatting, however, that don't seem to be working correctly.

The field is a date field and I am checking to see if the field1 <= DateAdd("d", 45, Date) then change the background to red and font yellow.  the field data = 2/01/2008 and current date = 2/17/2009  why doesn't it display the conditional formatting?

Question by:Karen Schaefer
    LVL 75

    Accepted Solution

    how about

    <= DateAdd("d", 45, Date() )
    parens                             ^^

    Author Comment

    by:Karen Schaefer
    Thanks that seems to return the conditionally formatting, however, my calculation is not returning what I was hoping for.

    I need to check and see if the date <= 30 days from current date, also note some of the dates can be quite old so I want to check the year and if the year is > than 1 year time span then format a different color, else than check if falls withing the 30 or 45 day criteria.

    so what do I need to do to the fomula to check the time frame criteria?

    Author Comment

    by:Karen Schaefer
    nevermind I figured it out by usin

    between Date() and DateSerial(Year(Date()),Month(Date()),Day(Date()+45))
    less than DateSerial(Year(Date()-1),Month(Date()),Day(Date()))
    LVL 75

    Expert Comment

    by:DatabaseMX (Joe Anderson - Access MVP)
    How about using DateDiff, for example:

    returns False

    returns True ...


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    This article is a continuation or rather an extension from Cascading Combos ( and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
    Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
    Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
    In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now