Count Check Box on Froms

  • Thread starter Thread starter Rui Soares via AccessMonster.com
  • Start date Start date
R

Rui Soares via AccessMonster.com

I have one form with several check box, that I need to count. If they are
checked.

A little help..... please

Thanks
 
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
 
Bill,

The code you sent to me, is 5*...

For each checked box I need to associate a code and then run only then code
of checked boxes.. can you help me??

Thanks
 
Back
Top