Results 1 to 5 of 5
  1. #1
    Khalil Handal is offline Competent Performer
    Windows 10 Access 2003
    Join Date
    Jun 2016
    Posts
    237

    change a control color based on a value

    Hi to all,
    I have a form with combobox named cboStatus. I want the color to be changed to dark red if the value is (Lost).
    Which is the better place to put the vba code event? On Load, or On Current......

    The user might change the value to (Lost) when the form is open for editing or the value might also be (Lost) when the form is opened.

    any ideas.

    sincerely yours
    Khalil

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    Use Conditional Formatting.
    no code needed.

  3. #3
    Khalil Handal is offline Competent Performer
    Windows 10 Access 2003
    Join Date
    Jun 2016
    Posts
    237
    Thanks ,
    I tried to do it and I have the following:
    Value = [Lost] (sample red text)

    This did not work. I am missing something
    Khalil

  4. #4
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,398
    to use the right syntax - do you mean you have a field called Lost or a field called something else which could have a value 'Lost'

    if the latter then your formula would be

    ="Lost"

  5. #5
    Khalil Handal is offline Competent Performer
    Windows 10 Access 2003
    Join Date
    Jun 2016
    Posts
    237
    Hi,
    My combo box has two columns the first one is the foreign key.
    It worked well when I used it.
    = 4

    Thank you for the help
    Khalil

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

Similar Threads

  1. Replies: 3
    Last Post: 03-21-2016, 07:03 AM
  2. Change Color of Box on Report based off Value
    By Nuke1096 in forum Access
    Replies: 10
    Last Post: 01-29-2014, 02:47 PM
  3. Replies: 3
    Last Post: 05-30-2013, 08:03 AM
  4. Change field color based on result
    By dniezby in forum Programming
    Replies: 1
    Last Post: 05-01-2013, 09:43 PM
  5. Replies: 4
    Last Post: 12-25-2011, 06:31 PM

Tags for this Thread

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