Results 1 to 6 of 6
  1. #1
    aaslezak is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2015
    Posts
    34

    Question Conditional background color

    In a report I want one of the fields to be a certain color based on a condition. How could I set that up in a report because when I go to the properties for that field it only allows me to pick one color.



    Al

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Try Conditional Formatting on the ribbon Format tab.
    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
    aaslezak is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2015
    Posts
    34
    The conditional formatting worked really well but I have to add and subtract a date in an expression and how does it know that I want days here is the expression from today's date to the due date Date()-[Projects]![Due Date]<1. Can you add and subtract dates like that and how does it know that I mean days or months or years?

  4. #4
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    You can use the DATEADD and DATEDIFF functions to do math on dates in Access.
    See: http://www.techonthenet.com/access/f...te/dateadd.php
    and http://www.techonthenet.com/access/f...e/datediff.php

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Yes, can add/subtract dates like that. The default unit when adding/subtracting dates is days. To specify other units, use DateAdd and DateDiff functions as indicated by JoeM.
    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
    aaslezak is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2015
    Posts
    34
    Thanks that helped a lot

    Al

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

Similar Threads

  1. Setting background color of combo box
    By Access_Novice in forum Forms
    Replies: 14
    Last Post: 01-07-2015, 08:19 AM
  2. Replies: 16
    Last Post: 12-02-2013, 06:20 AM
  3. Background Color
    By Meccer in forum Access
    Replies: 4
    Last Post: 05-30-2011, 06:49 AM
  4. Change Row Background Color Programmatically
    By sales@4bco.com in forum Programming
    Replies: 2
    Last Post: 10-25-2009, 11:17 AM
  5. background color in a form
    By taggart in forum Forms
    Replies: 1
    Last Post: 05-07-2009, 10:37 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