H
HeislerKurt
To be eligible for a study, a patient has to meet certain criteria.
There are 7 things that could prevent the patient from being eligible
(e.g., "Patient is ill," "Patient is pregnant," "Patient is on
medication," etc.).
On a form, these 7 criteria are listed as 7 check boxes (Yes/No
fields). The nurse is asked to "check all that apply." If at least one
of the 7 boxes is checked, a text box says, "Patient is NOT eligible."
If none of the 7 boxes is checked, the text box says, "Patient IS
eligible"
One way to code this is to create a command button that, when clicked,
evaluates the 7 check boxes and then returns the appropriate text. But
I'd like to avoid using a command button (it's one more thing the user
has to click, and it could easily be ignored). Instead, I'd like the
text box to get populated on the fly (as items are checked or
unchecked).
I could add an AfterUpdate code for each check box, something like ...
If chkCriteria1.Value = True OR chkCriteria2.Value = True OR ...
chkCriteria7.Value = True Then
Me.txtEligibility.Value = "Patient is NOT eligible."
Else
Me.txtEligibility.Value = "Patient IS eligible."
End If
But I would have to add this to all 7 checkboxes. Is there a more
efficient way to code this?
Thank you!
Kurt
There are 7 things that could prevent the patient from being eligible
(e.g., "Patient is ill," "Patient is pregnant," "Patient is on
medication," etc.).
On a form, these 7 criteria are listed as 7 check boxes (Yes/No
fields). The nurse is asked to "check all that apply." If at least one
of the 7 boxes is checked, a text box says, "Patient is NOT eligible."
If none of the 7 boxes is checked, the text box says, "Patient IS
eligible"
One way to code this is to create a command button that, when clicked,
evaluates the 7 check boxes and then returns the appropriate text. But
I'd like to avoid using a command button (it's one more thing the user
has to click, and it could easily be ignored). Instead, I'd like the
text box to get populated on the fly (as items are checked or
unchecked).
I could add an AfterUpdate code for each check box, something like ...
If chkCriteria1.Value = True OR chkCriteria2.Value = True OR ...
chkCriteria7.Value = True Then
Me.txtEligibility.Value = "Patient is NOT eligible."
Else
Me.txtEligibility.Value = "Patient IS eligible."
End If
But I would have to add this to all 7 checkboxes. Is there a more
efficient way to code this?
Thank you!
Kurt