Results 1 to 3 of 3
  1. #1
    BigJohn89 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Dec 2017
    Posts
    37

    Activate button when 2 checkbox are checked

    Hi, I want my button to be activate only when two checkboxes are checked.

    Button is disabled on load event:

    Private Sub Form_Load()
    btnClear.Enabled = False


    End Sub

    It's simple when only one checkbox is needed.

    Private Sub check1_Click()
    btnClear.Enabled = True
    End Sub

    How can I do this with two checkboxes?

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2013
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,543
    Try this code in the forms OnCurrent event and in the AfterUpdate event of both Checkboxes:
    Code:
    If Me.Checkbox1 = True AND Me.Checkbox2 = True Then
      Me.btnClear.Enabled = True
    Else
      Me.btnClear.Enabled =False
    EndIf
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    BigJohn89 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Dec 2017
    Posts
    37
    It's working Thank you!

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

Similar Threads

  1. Checkbox checked
    By brandy in forum Programming
    Replies: 2
    Last Post: 01-11-2017, 01:07 AM
  2. Checkbox Always Shows Checked
    By jo15765 in forum Forms
    Replies: 3
    Last Post: 08-16-2016, 06:58 AM
  3. If checkbox is checked allow query to run
    By burrina in forum Forms
    Replies: 14
    Last Post: 01-29-2013, 03:56 PM
  4. VBA for testing if checkbox is checked
    By rhewitt in forum Programming
    Replies: 0
    Last Post: 09-26-2012, 07:11 AM
  5. If checkbox is checked, add X to a current value
    By INeedAboutTreeFiddy in forum Programming
    Replies: 4
    Last Post: 05-30-2012, 08:17 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