Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Jul 2005
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Conditional Formatting Background Color (Access 2002 / VB 6.0)

    I would like to apply a conditional format to the background of a form. I want to set the background color based on the value of a checkbox on the form. It's easy enough to use conditional formatting on an individual control but I'd rather have the form background color change. Is there a good VB code I could apply to 'on click' of the check box? Maybe there is an easier way or no way at all???

    Thanks!
    -Tony

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Conditional Formatting Background Color (Access 2002 / VB 6.0)

    You can do the following:
    - Create a text box in the detail section of the form.
    - Set its control source to the field the check box is bound to.
    - Set its Format property to a semi-colon ; (this will hide the text)
    - Use conditional formatting to set the background color the way you want depending on the field value.
    - Set the Locked property of the text box to Yes, and Enabled to No.
    - Resize the text box to cover the entire detail section.
    - Select Format | Send to Back.

    This will work both in a single form and in a continuous form. Setting the background color of the detail section in code will not work as desired in a continuous form.

  3. #3
    New Lounger
    Join Date
    Jul 2005
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Conditional Formatting Background Color (Access 2002 / VB 6.0)

    Okay great......

    Thanks!!

Posting Permissions

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