Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2012
    Posts
    3

    Unanswered: Conditional Format Textbox

    Hi all,

    I am a very basic user of Microsoft Access with no formal training. I had to build a database for work originally in Excel, but it took too much time when updating it on a weekly basis. So I switched to Access and cut my work on this database by two-thirds each week.

    I need help with the following:

    I need to have Textbox 71 of my reports highlight in red when the following two conditions are meet:
    1. Textbox 67 = "M"
    2. Textbox 71 > "13:00"

    I have used Conditional Format for Textbox 71 to highlight another condition when the value in the Textbox 71 is greater than "14:30" for all values.

    I am guessing I need to write some sort of formula, but have no idea where to begin.

    Any help is greatly appreciated.

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Select [Textbox 71] when the report is in design view then right-click. In the contextual menu, select Conditional Formatting. In the dialog box, specify the conditions and the format you want for the TextBox (see attached picture).

    Note: You should refrain from using spaces or other non-alphanumeric characters in the names of the objects (the underscore "_" is ok).
    Attached Thumbnails Attached Thumbnails ConditionalFormat.jpg  
    Have a nice day!

  3. #3
    Join Date
    Aug 2012
    Posts
    3
    Sinndho - I appreciate the quick response. Unfortunately this causes an issue with my previous conditional format.

    Textbox67 reflects either M (for male) or F (for female). If the textbox67 returns M and Textbox71 is above "13:00" I need Textbox71 to turn red.

    However, if Textbox67 is F, Textbox71 turns red only when it is above "14:30." The current conditional format does this just fine since I set it to turn red above "14:30" no matter the value in Textbox67.

    With your recommendation it has caused Textbox71 to turn red whenever the value is above "13:00."

  4. #4
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    You can always combine both conditions in a single expression:
    Code:
    [Textbox 67] = "M" AND [Textbox 71] > "13:00"
    Have a nice day!

  5. #5
    Join Date
    Aug 2012
    Posts
    3
    Sinndho - GREAT!!! So simple. Thanks so much. I can't tell you how much that little thing has plagued me for some months now.

  6. #6
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    You're welcome!
    Have a nice day!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •