J
j.t.w
I have a subform in datasheet view with 2 checkboxes for each record.
I want to check each record to see if at least one checkbox is set to
"true" (checked) and have it be counted.
I found and modified this code, that comes close, but not exactly.
intTotalChecked = 0
For Each ctl In Forms!frm_InvoiceStatus!subfrm_InvoiceStatus.Form
If ctl.ControlType = acCheckBox Then
If ctl.Value = True Then
intTotalChecked = intTotalChecked +1
End If
End If
Next
MsgBox = "Total Boxes Checked =" & intTotalChecked
Stepping through the code, it seems to loop through the controls and
checks the value of the checkboxes correctly, but only once and not
for all of the records that are showing. I think this would work for a
single form view. Is there a way to count the number of records with
checked checkboxes that are visibly shown on the current subform and
not based on a query?
I'm trying to let the users know how many records they have checked
before refreshing the main form, which will no longer show after
clicking on the "next" button.
Anyway, hope someone can help me. TIA.
j.t.w
I want to check each record to see if at least one checkbox is set to
"true" (checked) and have it be counted.
I found and modified this code, that comes close, but not exactly.
intTotalChecked = 0
For Each ctl In Forms!frm_InvoiceStatus!subfrm_InvoiceStatus.Form
If ctl.ControlType = acCheckBox Then
If ctl.Value = True Then
intTotalChecked = intTotalChecked +1
End If
End If
Next
MsgBox = "Total Boxes Checked =" & intTotalChecked
Stepping through the code, it seems to loop through the controls and
checks the value of the checkboxes correctly, but only once and not
for all of the records that are showing. I think this would work for a
single form view. Is there a way to count the number of records with
checked checkboxes that are visibly shown on the current subform and
not based on a query?
I'm trying to let the users know how many records they have checked
before refreshing the main form, which will no longer show after
clicking on the "next" button.
Anyway, hope someone can help me. TIA.
j.t.w