Results 1 to 2 of 2
  1. #1
    stildawn is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2013
    Posts
    185

    Datasheet View Form - Conditional Formatting - Choosing between two conditions

    Hi All

    I have a form in Datasheet view.

    I have two conditional formatting conditions I would like to use on all the records in the form.



    First is
    Expression: [Added TimeStamp]>Date() - Color in text as BLUE

    Second is
    Expression: [Expected Arrival Date]<Date()+7 - Color in text as RED


    The thing is, that both these conditions can be true at the same time, what I would ideally like to do is use a If statement or something like in VBA it would look something like this as an idea:

    Code:
    If [Expected Arrival Date]<Date()+7 = True
        Color text as Red
    Else
        If [Added TimeStamp]>Date() = True
            Color text as Blue
        Else
            Leave color as default
    End If
    So, the second expression takes priority so all EAD<Date()+7 will be RED, if not then it might be BLUE if AddedTime>Date(), if both are not true then it will be left as default.

    Any ideas on how to do this?

    Thanks

  2. #2
    stildawn is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2013
    Posts
    185
    Sorry needed to rewrite the second expression is now this:

    IIf([Transhipment]=-1,[Expected Arrival Date]-Date()<8)

    So it checks if a field =-1, if it does then it does then it finds if the difference between EAD and current date is less that 8. This needs to return RED, and if not then it should check for the BLUE condition?



    Alternatively, does anyone know how to run a Background Color conditional formatting on a Yes/No field? The Conditional Formatting open greys out when I select the "Transhipment" field which is a Yes/No field (with tickbox). If I could change the fields background color to RED for when the above expression is true, then I can just leave all the other conditional formatting doing the BLUE operation.

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

Similar Threads

  1. Replies: 8
    Last Post: 01-10-2014, 12:38 PM
  2. Replies: 1
    Last Post: 04-24-2013, 08:51 PM
  3. Conditional Formatting with more than 3 conditions
    By cactuspete13 in forum Programming
    Replies: 3
    Last Post: 12-10-2012, 01:03 PM
  4. Formatting a number field for datasheet view
    By RamiMohaisen in forum Access
    Replies: 3
    Last Post: 02-08-2012, 05:46 PM
  5. COnditional Formatting on a Datasheet
    By anoob in forum Access
    Replies: 2
    Last Post: 02-28-2011, 12:48 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