Hi,
I have a form based on a query. On the query is a button to print a report. Since a user may not want to print all records, I have added a checkbox on the form. The default value of the checkbox is false. The report filters on the checkbox being true.
All is fine, when the user marks records seperately.
However, I tried to add a button mark all, but when clicked, it only marks the current record.
This is the code I have so far:
Private Sub CheckAll_Click
Dim ctl As Control
Dim intCount As Integer
For Each ctl In Me.Controls
If ctl.ControlType = acCheckbox Then
ctl = True
End If
Next ctl
End Sub
Can anyone help me out here?
I have a form based on a query. On the query is a button to print a report. Since a user may not want to print all records, I have added a checkbox on the form. The default value of the checkbox is false. The report filters on the checkbox being true.
All is fine, when the user marks records seperately.
However, I tried to add a button mark all, but when clicked, it only marks the current record.
This is the code I have so far:
Private Sub CheckAll_Click
Dim ctl As Control
Dim intCount As Integer
For Each ctl In Me.Controls
If ctl.ControlType = acCheckbox Then
ctl = True
End If
Next ctl
End Sub
Can anyone help me out here?