I'd really appreciate some help. I am just learning VBA on my own.
I have a form with 3 checkboxes: ActiveStatus, Newsletter, and AnnualReport. I have placed code in the On Click event of the ActiveStatus control to prevent the user from CHECKING either the Newsletter or AnnualReport unless ActiveStatus is already checked. Conversely, if Newsletter or AnnualReport are checked, then ActiveStatus cannot be UNCHECKED. This all works fine.
I also have a subform to the right of these check boxes that should display the COUNT for each checkbox. That is, it shows the total of how many checks there are in the table for each checkbox.
The problem is this - unless at least one of each checkbox is CHECKED in the TABLE (not an individual record) the subform will not display the counts.
I suspect the problem may be in the following code I placed in the ON CLICK event of the ActiveStatus checkbox to prevent the user from unchecking ActiveStatus if one of the other checkboxes is checked:
Private Sub chkActiveStatus_Click()
If Me!Newsletter = -1 Or Me!AnnualReport = -1 then
Me!ActiveStatus = 1
MsgBox ("Other options must be unchecked first") vbInformation, "Checking Status"
Endif
End Sub
Sorry for such a lengthy explanation but I don't know any other way to present the problem.
Thanks
I have a form with 3 checkboxes: ActiveStatus, Newsletter, and AnnualReport. I have placed code in the On Click event of the ActiveStatus control to prevent the user from CHECKING either the Newsletter or AnnualReport unless ActiveStatus is already checked. Conversely, if Newsletter or AnnualReport are checked, then ActiveStatus cannot be UNCHECKED. This all works fine.
I also have a subform to the right of these check boxes that should display the COUNT for each checkbox. That is, it shows the total of how many checks there are in the table for each checkbox.
The problem is this - unless at least one of each checkbox is CHECKED in the TABLE (not an individual record) the subform will not display the counts.
I suspect the problem may be in the following code I placed in the ON CLICK event of the ActiveStatus checkbox to prevent the user from unchecking ActiveStatus if one of the other checkboxes is checked:
Private Sub chkActiveStatus_Click()
If Me!Newsletter = -1 Or Me!AnnualReport = -1 then
Me!ActiveStatus = 1
MsgBox ("Other options must be unchecked first") vbInformation, "Checking Status"
Endif
End Sub
Sorry for such a lengthy explanation but I don't know any other way to present the problem.
Thanks