Results 1 to 2 of 2

Thread: check boxes

  1. #1
    Join Date
    Jul 2004

    Unanswered: check boxes

    so when i use check boxes on update forms I thought they toggled between 1 and 0 depending on if they were checked or not.

    well I am having a problem I have 14 check boxes on two different tabs on one update form and when I chec them I dont want anything to happen untill I hit the Update command button that is susposed to take all the new information I put on the userform and upt it to the spreadsheet. So I put the code under

    updatebtn click()
    if checkbox = 1 then
    range(c3) = "x"
    end if

    but nothing happens. Any help?

  2. #2
    Join Date
    Jan 2004
    Aberdeen, Scotland
    When you check a checkbox you can examine it's property by looking at it's value

    i.e checkbox.value = true

    since you are using multiple checkboxes on a single user form i would suggest running something like this

    Private Sub CmdAll_Click()
        Dim aControl As MSForms.Control
        'Check which box is checked
        For Each aControl In Me.Controls
            If TypeOf aControl Is MSForms.CheckBox Then
                'check to see if checkbox is checked
                If aControl.Value = True Then
                    'put your code here
                End If
            End If
        Next aControl
    End Sub
    this examines the property of all the checkboxes on your form,


Posting Permissions

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