how can i write a code for a cancel button that this set the value of all checkboxes on a form to "vbunchecked"?????
f.Ex. checkbox 1 to 10 are "checked" , cancel button is down , value of checkbox 1 to 10 should be "vbunchecked"!
Printable View
how can i write a code for a cancel button that this set the value of all checkboxes on a form to "vbunchecked"?????
f.Ex. checkbox 1 to 10 are "checked" , cancel button is down , value of checkbox 1 to 10 should be "vbunchecked"!
Try this:
Code:Private Sub Command1_Click()
For Each MyControl In Me.Controls
If TypeOf MyControl Is CheckBox Then MyControl.Value = vbUnchecked
Next
End Sub
Put a timer on a form, interval 1000, put the checkboxes in an array:
Oh sh*t, didn't read your post with much concentration :)Code:Private Sub Timer1_timer()
Dim x As Integer
For x = Check1.Lbound To Check1.Ubound
If Check1(x).Value = False Then
Command1.Enabled = False
Exit Sub
End If
Next x
Command1.Enabled = True
End Sub
Use Matthew's code...
I keep my code here for anyone who needs it sometime
[Edited by Jop on 10-08-2000 at 03:49 PM]