Results 1 to 7 of 7
  1. #1
    darwin is offline Novice
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    28

    Yes/no checkbox event when check

    hi

    I have a checkbox, and a textbox

    when check the checkbox then the backcolor in the textbox must be red

    I try this with no succes, checkbox name is Ma1 and textbox name is Ma1tekst

    Private Sub Ma1_AfterUpdate()
    If Me.Ma1 = 1 Then


    Ma1tekst.ForeColor = red
    End If
    End Sub

  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
    53,625
    Should use Conditional Formatting for this. No VBA required.
    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
    darwin is offline Novice
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    28
    with conditional formatting you mean the expression bouilder ?

  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
    53,625
    No, I mean Conditional Formatting from the Format tab on the ribbon.
    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
    darwin is offline Novice
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    28
    ok yes but an issue, when I select/mark the yes/no checkbox, the conditionel formatting is not posible ??

    when I select/mark a textbox no issue ?

  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
    53,625
    The Conditional Formatting should be set on the textbox. The conditional expression for changing the color would be:

    [Ma1] = True


    Also note, the numeric constant for True/Yes in Access is -1, not 1.
    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
    darwin is offline Novice
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    28
    Great thanks I learn every day

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

Similar Threads

  1. AfterUpdate Event Based on Checkbox
    By lisa071 in forum Forms
    Replies: 3
    Last Post: 03-27-2015, 01:12 PM
  2. Check Box Event Order
    By Aaron5714 in forum Forms
    Replies: 1
    Last Post: 10-04-2013, 04:54 PM
  3. Setting CheckBox value in form using VBA/Event
    By Monterey_Manzer in forum Forms
    Replies: 7
    Last Post: 05-10-2013, 11:37 AM
  4. Noob Question macro to check checkbox
    By bradmitchell in forum Access
    Replies: 1
    Last Post: 05-13-2012, 10:08 PM
  5. Replies: 22
    Last Post: 11-14-2011, 10:29 AM

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