If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > check boxes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-02-04, 08:45
VBALordCorp VBALordCorp is offline
Registered User
 
Join Date: Jul 2004
Posts: 34
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?
Reply With Quote
  #2 (permalink)  
Old 08-02-04, 10:32
DavidCoutts DavidCoutts is offline
Registered User
 
Join Date: Jan 2004
Location: Aberdeen, Scotland
Posts: 1,067
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

Code:
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,

HTH
David
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On