Checkbox Question

P

Playa

I have added a checkbox to one of my reports and depending on what other
checkboxes on my report are checked off I want the checkbox I added to either
be checked or unchecked.
Here is an example.

Physio FD Visit SMGH Visit FA Form Required
[ ] [ ] [ ] [x] [
]
[x] [ ] [ x] [ ] [x ]

I want the "Form Required" checkbox to be checked if anyone of the following
are checked off "Physio", "FD Visit", and "SMGH Visit". If just "FA" is
checked then I don't want "Form Required" to get checked.

This is what i have in the "Form Required" Control Source Property....
=IIf([Physio] Or [FD Visit] Or [SMGH visit],True,True)
But this makes the "Form Required" checkbox set to True(checked) all the
time, no matter what senerio.

Can anyone help me with my IIF statement.

Thanks in advance.
 
G

Guest

the forms control source may not be the right place.
you may need to create a sub for each check box.
here is code i wrote for such a situation.
Private Sub chkExEmp_Click()

If Me.chkExEmp = True Then
Me.chkOld = False
Me.ChkNegBal = False
Me.chkCurrent = False
End If

End Sub
here i just made sure that if the employee check was
checked, the other 3 checks were unchecked.
Private Sub chkCurrent_Click()

If Me.chkCurrent = True Then
Me.chkOld = False
Me.ChkNegBal = False
Me.chkDate = False
Me.txtDateInput.Enabled = False
Me.txtDateInput = Null
Me.txtEmpID.Enabled = True
Me.txtEmpName.Enabled = True
Me.txtEmpID = Null
Me.txtEmpName = Null
Me.txtEmpID.SetFocus
End If

End Sub
Here i was not only make sure the other check were uncheck
but disableing other controls on the form and clearing
text boxes.
You may need a sub for each one of your check boxes
stating what other checks should be check or uncheck if a
perticular check is checked or unchecked.
good luck
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top