Private Sub CountChecks()
Dim ctl As Control
Dim intCount As Integer
intCount = 0
' Enumerate Controls collection.
For Each ctl In Me.Controls
' Check to see if control is check box.
If ctl.ControlType = acCheckBox Then
intCount = intCount + Abs(Nz(ctl.Value, 0))
End If
Next ctl
MsgBox "You checked: " & intCount & " checkboxes"
End Sub
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.