I am trying to create a button that will check all "checkBox"s on a sub form. I have created a form that has a subform on it, in the subform are checkboxes, the checkboxes are tied to a true/false field in a table. I have the button on the main form. This code may be way off, I am a huge "rookie" when it comes to VBA for Access2000. I am not sure if this code is even the correct one I need. The subform is called "sfrmClose" and the form is called "frmClose". What I am attempting to do here is loop through the sub form and set all the checkboxes to true when the button is clicked. When I try to run the code it comes back with a variable not defined error on the SubForm.Controls line.
Private Sub Check_All_Click()
Dim ckb as CheckBox
For Each ckb In SubForm.Controls
If acCheckBox = False Then
.acCheckBox = True
End If
Next ckb
End Sub
Private Sub Check_All_Click()
Dim ckb as CheckBox
For Each ckb In SubForm.Controls
If acCheckBox = False Then
.acCheckBox = True
End If
Next ckb
End Sub