Enabling a check box under certain conditions.

Status
Not open for further replies.

kyuball

Registered User.
Local time
Yesterday, 16:05
Joined
Jul 6, 2009
Messages
66
* I had originally posted this in the VBA section and realized that I had misfiled it...

I was wondering if this was possible:

I am using a form with checkboxes that also populates a table with several checkboxes to give profile information on mental health clients. All of the fields are independent of the others (e.g. "physical disabilities" can be checked alongside "domestic violence issues" etc.) with the exception of one. The last checkbox is called "Other" and there is a memo field where they can specify what that other is. However, one of the most common "other" is general health concerns (I cannot add general health concerns as a check box as the content of the data we are keeping track of is determined by an outside funding agency), and we wanted to keep track of how many of the "other"s are just health issues. So, I added a checkbox field called "otherishealth" at the end of the client profile table and disabled the control for that field without locking it on the form. What I would want to do is have the control for "otherishealth" to be enabled only when "other" has been checked off.

My assumption is that the code of it would start like this:

Private Sub other_AfterUpdate()
If IsTrue(other) Then
me.otherishealth = ??????

This form is set to not save the record until a save button has been clicked (a little trick that I got from these very same forums), so I can't set up a separate table for the "otherishealth" field and have a separate form pop up for that condition.

Any help?
 
Well, the questioned line would be:

me.otherishealth.Enabled = True

You'd want an Else to set it to false if the condition isn't met. You may also want the same code in the current event to handle the changing of records.
 
I think your pretty close

Try Using the onClick event

If Me.Check0 = True Then
Me.Check2.Enabled = True
Else
Me.Check2.Enabled = False
End If
 
Lagbolts reply on your other post has some good logic
 
Lame job on the double post kyuball.
 
Status
Not open for further replies.

Users who are viewing this thread

Back
Top Bottom