Results 1 to 3 of 3
  1. #1
    Join Date
    May 2006

    Unanswered: Need Urgent Help with Conditional Formatting on a Form please!!

    Dear All,

    I am really stressed out here. I have been given a task by my manager to insert some conditional fields on a form based like a combo box which basically has the following options to select from the list:
    None Selected

    These fields are used for employees. Basically, what we want is this:

    If Yes is selected in a combo box then the back colour should be filled with Green and If No is selected or is blank, then the back colour should be filled with Red colour and if None Selected or "Awaiting is selected then the back colour for the each combo box should be Pink

    To do this, I inserted each field (combo box) on the form. I then clicked on that field and then went to Format and then clicked on Conditional Formatting and then chose " where the value is: euqal to "Yes" fill the background with red etc. But for some reason it just does not change any field.

    Any help would be greatfully appreciated.
    Love begets Love, Help Begets Help

  2. #2
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    I'd suggest you place some code behind various objects

    create a function which sets the relevant settings
    in the forms on current record event call that function
    in the combo's on change event likewise


    private sub SetComboBackground()
    switch case mycombo.value
    case '': BackColour = ???? 'rgb value or intrinsic VB colour constant
    case 'Yes': BackColour = vbgreen
    case 'No': backcolour = vbred
    case 'Awaiting' : backcolour = ???? 'rgb value or intrinsic VB colour constant
    end select
    mycombo.backcolor = backcolour
    end sub
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Aug 2011
    Indianapolis, IN, USA
    You might want to check out this article from M$. It’s lengthy and appears to cover all versions of Access that support conditional formatting. WARNING! It doesn't look easy.

    How to programmatically apply conditional formatting settings to all form controls

Posting Permissions

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