I tried this VBA code but it's going down on the For Each line
Private Sub AttestationCheck_AfterUpdate()
Dim MyAttestedGrandTotal As Currency
Dim MyRunningTotal As Currency
Dim MyAttestedRecsTotal As Integer
Dim ctrl As Control
Dim ctrlType As String
'What control type to loop through
ctrlType = "Checkbox"
'Loop through each Checkbox control on UserForm
MyRunningTotal = 0
For Each ctrl In frmWeeklyClaimsReviewQueueSUB.Controls
'Checked
If AttestationCheck(ctrl) = ctrlType Then
If AttestationCheck.Value = -1 Then
MyAttestedGrandTotal = AttestedAmountBIlled.Value + MyRunningTotal And MyAttestedRecsTotal = MyAttestedRecs + 1
MyRunningTotal = MyRunningTotal + AttestedAmountBIlled.Value
Else
'Unchecked
MyAttestedGrandTotal = AttestedAmountBIlled.Value - MyRunningTotal And MyAttestedRecsTotal = MyAttestedRecs - 1
MyRunningTotal = MyRunningTotal - AttestedAmountBIlled.Value
End If
End If
Next
DoCmd.RunMacro "mcrAttestCheckboxControlProcess"
End Sub