Results 1 to 6 of 6
  1. #1
    caniread is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2015
    Posts
    86

    Conditional formatting using combo box selection


    I want to setup conditional formatting that will turn the box green or red. The problem is that the values need to change depending on a combo drop box value. Is there an expression I can use to tell it to look at the combo box then use a certain value depending on the combo box?

  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,929
    Yes. What exactly do you not understand about setting Conditional Formatting? Start a New Rule and select Expression Is.

    Are the combobox and textbox on same form? Is the combobox value number type?

    [comboboxname]=something
    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
    caniread is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2015
    Posts
    86
    Combo box and text box is on the same form. Combo box are names text box are numbers. Here is a better explanation I think. If combo box = this name then between these two values go green. Here is what I tried but is not working. [Material]![Material]="CA10A" & [Results]![Melt Flow] Between 0.45 And 0.8

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    & is for concatenation, not logical expression.

    [Material]="CA10A" And [Melt Flow] Between 0.45 And 0.8

    I am not sure BETWEEN AND will work so maybe:

    [Material]="CA10A" And [Melt Flow] >= 0.45 And [Melt Flow] <= 0.8
    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.

  5. #5
    caniread is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2015
    Posts
    86
    Thank you!!!! Had to tweak it a little but got it to work. Had to use the ID # instead of text "CA10A". Not sure why it didn't work the other way.

    [Material]=1 And [Melt Flow]>=0.45 And [Melt Flow]<=0.8

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Because the value of the combobox is the ID not the alias text displayed.
    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.

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

Similar Threads

  1. conditional formatting
    By azhar2006 in forum Forms
    Replies: 4
    Last Post: 07-14-2014, 10:26 AM
  2. Replies: 6
    Last Post: 05-26-2013, 09:10 PM
  3. Replies: 2
    Last Post: 01-21-2013, 10:38 PM
  4. conditional formatting right(..)
    By bbeernaert in forum Access
    Replies: 3
    Last Post: 08-25-2010, 12:33 AM
  5. Conditional formatting
    By ylivne in forum Reports
    Replies: 1
    Last Post: 07-12-2009, 06:18 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