Results 1 to 7 of 7
  1. #1
    matey56 is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Jul 2020
    Posts
    137

    Conditional Formatting Month


    Hi,
    I have a form that pulls a date from a query in the 2/23/2022 format and displays it as Feb-22 in the form. Is there a way to use conditional formatting to color code each month in that control? In other words, if Feb it's red, March it's blue, April it's green, etc.?

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    You could use the Month() function with your field. An expression like:

    Month([FieldName]) = 1
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    matey56 is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Jul 2020
    Posts
    137
    Quote Originally Posted by pbaldy View Post
    You could use the Month() function with your field. An expression like:

    Month([FieldName]) = 1
    Worked like a charm. Thanks!

  4. #4
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    matey56 is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Jul 2020
    Posts
    137
    One more question actually....so the month formula colors the date cell that I want. What if I want to also have it color the adjacent cell the same color? What do I need to do?

  6. #6
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    The same expression should work in those textboxes. You can select multiple textboxes and apply the same conditional format to all.

    An alternative is a single textbox behind all the others with the conditional format, and if memory serves the textboxes on top have their back style set to transparent.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    matey56 is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Jul 2020
    Posts
    137
    Quote Originally Posted by pbaldy View Post
    The same expression should work in those textboxes. You can select multiple textboxes and apply the same conditional format to all.

    An alternative is a single textbox behind all the others with the conditional format, and if memory serves the textboxes on top have their back style set to transparent.
    Awesome, it worked. I should have known that.

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

Similar Threads

  1. Conditional Formatting
    By Bnecrush1 in forum Access
    Replies: 14
    Last Post: 02-05-2021, 09:59 AM
  2. month formatting
    By fishhead in forum Programming
    Replies: 5
    Last Post: 06-03-2020, 03:09 PM
  3. Replies: 2
    Last Post: 11-12-2015, 10:46 AM
  4. Replies: 6
    Last Post: 05-26-2013, 09:10 PM
  5. Replies: 5
    Last Post: 08-20-2012, 11:11 PM

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