+ Reply to Thread
Results 1 to 6 of 6

Setting a CheckBox Value to False

  1. #1
    The Hawk
    Guest

    Setting a CheckBox Value to False

    Hi: I'd like to set a checkbox value to false after selection of an item
    from a Combo Box. I've tried various things, but cannot seem to get the
    correct syntax. Both the Combo Box and Check Box are on a User Form. The
    latest code tried is:

    Private Sub cmbMembers_Change()
    If Val(cmbMembers.Value) > 0 Then
    Cells(cmbMembers.Value, 1).Select
    CheckBox1.Enabled = True: Value = False
    Else
    CheckBox1.Enabled = False
    CheckBox2.Enabled = False
    CheckBox3.Enabled = False
    End If
    End Sub

    Any help will be appreciated...

  2. #2
    Ron de Bruin
    Guest

    Re: Setting a CheckBox Value to False

    Hi

    You must use the value property of the checkbox

    CheckBox1.Value = False

    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "The Hawk" <[email protected]> wrote in message news:[email protected]...
    > Hi: I'd like to set a checkbox value to false after selection of an item
    > from a Combo Box. I've tried various things, but cannot seem to get the
    > correct syntax. Both the Combo Box and Check Box are on a User Form. The
    > latest code tried is:
    >
    > Private Sub cmbMembers_Change()
    > If Val(cmbMembers.Value) > 0 Then
    > Cells(cmbMembers.Value, 1).Select
    > CheckBox1.Enabled = True: Value = False
    > Else
    > CheckBox1.Enabled = False
    > CheckBox2.Enabled = False
    > CheckBox3.Enabled = False
    > End If
    > End Sub
    >
    > Any help will be appreciated...




  3. #3
    Registered User
    Join Date
    06-29-2005
    Posts
    46
    or

    With CheckBox1
    .Enabled = True
    .Value = False
    End With

  4. #4
    Registered User
    Join Date
    07-05-2005
    Posts
    11
    Or:

    'I am assuming the name of the form is UserForm1

    UserForm1.Controls("CheckBox1").Value = False

    Hope this helps

    theguz

  5. #5
    Tom Ogilvy
    Guest

    Re: Setting a CheckBox Value to False

    Private Sub cmbMembers_Change()
    If Val(cmbMembers.Value) > 0 Then
    Cells(cmbMembers.Value, 1).Select
    CheckBox1.Enabled = True
    CheckBox1.Value = False
    Else
    CheckBox1.Enabled = False
    CheckBox2.Enabled = False
    CheckBox3.Enabled = False
    End If
    End Sub



    "The Hawk" <[email protected]> wrote in message
    news:[email protected]...
    > Hi: I'd like to set a checkbox value to false after selection of an item
    > from a Combo Box. I've tried various things, but cannot seem to get the
    > correct syntax. Both the Combo Box and Check Box are on a User Form. The
    > latest code tried is:
    >
    > Private Sub cmbMembers_Change()
    > If Val(cmbMembers.Value) > 0 Then
    > Cells(cmbMembers.Value, 1).Select
    > CheckBox1.Enabled = True: Value = False
    > Else
    > CheckBox1.Enabled = False
    > CheckBox2.Enabled = False
    > CheckBox3.Enabled = False
    > End If
    > End Sub
    >
    > Any help will be appreciated...




  6. #6
    The Hawk
    Guest

    RE: Setting a CheckBox Value to False

    Folks: I figured it out. Here's the final code:
    Private Sub cmbMembers_Change()
    If Val(cmbMembers.Value) > 0 Then
    Cells(cmbMembers.Value, 1).Select
    CheckBox1.Enabled = True
    CheckBox1.Value = Cells(cmbMembers.Value, 4)
    Else
    CheckBox1.Enabled = False
    CheckBox2.Enabled = False
    CheckBox3.Enabled = False
    End If
    End Sub

    Thanks...

    "The Hawk" wrote:

    > Hi: I'd like to set a checkbox value to false after selection of an item
    > from a Combo Box. I've tried various things, but cannot seem to get the
    > correct syntax. Both the Combo Box and Check Box are on a User Form. The
    > latest code tried is:
    >
    > Private Sub cmbMembers_Change()
    > If Val(cmbMembers.Value) > 0 Then
    > Cells(cmbMembers.Value, 1).Select
    > CheckBox1.Enabled = True: Value = False
    > Else
    > CheckBox1.Enabled = False
    > CheckBox2.Enabled = False
    > CheckBox3.Enabled = False
    > End If
    > End Sub
    >
    > Any help will be appreciated...


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1