Results 1 to 6 of 6
  1. #1
    cyberw00 is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    3

    Changing the background color of a record, based on a yes/no value

    I am rebuilding a file that deals with a lot of active and inactive accounts. I would like to change the inactive record to a yellow or red when a check box is marked. It has been about 15 years since I have written any macros or VB functions. Any feed back is appreciated.

    Thank You

  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,822
    Use Conditional Formatting of textboxes. This is a design edit of textboxes. No VBA or macros needed.
    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
    cyberw00 is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    3
    So my code should look something like

    <code>

    IF Sheet2.Active = "yes" then
    bg_color="null"

    If Sheet2.active = "No" then bg_color = #A00404

    End IF

    (/code)

  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,822
    Don't understand. Is Excel somehow involved in this?

    What is bg_color?

    Conditional Formatting of textboxes does not use VBA code. Conditional Formatting is a wizard on the ribbon Design tab.
    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
    cyberw00 is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    3
    Quote Originally Posted by June7 View Post
    Don't understand. Is Excel somehow involved in this?

    What is bg_color?

    Conditional Formatting of textboxes does not use VBA code. Conditional Formatting is a wizard on the ribbon Design tab.





    As I mentioned I am pretty out of practice with this... Thank You for all of your feed back up to this point. It has been helpful. I have had some time to play with the conditional formatting a little. I have determined how to make the cell change colors within the report. Are there any tricks for the entire row? I would like the entire canceled record to light up.

    Thanks again

  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,822
    Reports don't really have rows, not as understood in Excel. Must apply Conditional Formatting to every textbox. If you don't want any white space between them, options:

    1. Size and position textboxes so they 'run together'.

    2. Use Conditional Formatting on an unbound textbox sized to full report width behind other textboxes set to transparent.

    3. Concatenate data into a single textbox.
    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. Replies: 3
    Last Post: 04-28-2013, 04:10 PM
  2. Replies: 2
    Last Post: 03-05-2013, 04:11 PM
  3. Background Color
    By Meccer in forum Access
    Replies: 4
    Last Post: 05-30-2011, 06:49 AM
  4. Changing font color based on criteria
    By Pattie Weaver in forum Reports
    Replies: 5
    Last Post: 11-02-2010, 03:38 PM
  5. background color in a form
    By taggart in forum Forms
    Replies: 1
    Last Post: 05-07-2009, 10:37 AM

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