Results 1 to 8 of 8
  1. #1
    survivo01 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    71

    conditional formatting of a checkbox

    I found this formula in the search. but I am not sure whether I am using correctly. (Wish I had kept the Name of who showed it)



    I have a checkbox yes/no called GED I am assuming if it is blank the answer is no and I am using this formula if [ABE] = No then [ABE].forecolor = vbred else [ABE].forcolor = vbblack Also, what event should it be listed as.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    Is this on a form or report that displays multiple continuous records? Don't use event coding. Use Conditional Formatting.

    Use Nz function to return a value if field is null.

    Nz([ABE],No) = No
    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
    survivo01 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    71
    Do you mean the conditional formatting that is built in. I tried to change the check boxes to text boxes and for some reason the conditional formatting tool did not work. I guess I am not making myself clear. I just want to make my check box red if it is no

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    Well, darn! Checkboxes don't have BackColor or Font properties and therefore don't have conditional formatting although would be nice to use CF to enable/disable checkbox. However, a textbox bound to a Yes/No field should have both available - does for me.

    VBA method will work if only one record at a time displays. Put code in the form Current event and maybe even in the textbox AfterUpdate event.
    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
    survivo01 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    71
    Okay, I changed the check box to text box. I used the conditional formatting tool. The tool appeared to work fine but nothing changed on the form. I have used it before without problem. I don't know if it should make a difference this is the main form that contains a sub form

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    Select ExpressionIs in the CF wizard.

    Then try:

    Nz([ABE],No) = No

    or

    Nz([ABE],False) = False

    or

    Nz([ABE],0) = 0

    Work for me.
    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.

  7. #7
    survivo01 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    71
    I did what you suggested and I get nothing. I am using ACCESS 2007. Could I have something wrong with my program

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    I would have to examine the database. If you want to provide follow instructions at bottom of my post. However, I will not be able to work with db files for 2 weeks starting tomorrow.
    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 riaarora in forum Access
    Replies: 6
    Last Post: 09-03-2012, 05:58 AM
  2. Conditional Formatting
    By schwabe in forum Reports
    Replies: 2
    Last Post: 02-01-2012, 10:28 AM
  3. Conditional Formatting
    By Paul H in forum Reports
    Replies: 3
    Last Post: 11-07-2011, 11:59 AM
  4. Conditional Formatting
    By mm07nkb in forum Forms
    Replies: 1
    Last Post: 09-02-2011, 09:58 AM
  5. Conditional Formatting
    By cevatyildiz in forum Forms
    Replies: 8
    Last Post: 04-30-2010, 12:01 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