Enable text box when a check box has been clicked

I have a form that has a check box and a text box on it.  When I click on the check box I want the text box to be visible.  Conversely, when the check box in unchecked, I want the text box to not be visible.  I am using the attached code to accomplish this.  The problem I'm having is that when I click on the check box for one record, the text box becomes visible for all subsequent records.  How do I make this work for each record independently?
Private Sub PI_Click()
If PI.Value = 0 Then
PI_Adj.Visible = False
Else
PI_Adj.Visible = True
End If

Open in new window

cobiannaAsked:
Who is Participating?
 
Rey Obrero (Capricorn1)Commented:
oh. also use the current event of the form to check the status of the check box

private sub form_current()

me.PI_Adj.visible=me.PI.value

end sub
0
 
Rey Obrero (Capricorn1)Commented:
so, you have a continuous form.
you have to bind the checkbox to a yesno field in your table.
0
 
cobiannaAuthor Commented:
Actually, it's a single form.  I am pulling the check box from a yes/no field in my table.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
cobiannaAuthor Commented:
I tried that.  I'm still having the same issue.
0
 
Rey Obrero (Capricorn1)Commented:
can you attach your db?
0
 
cobiannaAuthor Commented:
I can't.  It contains sensitive information.  Sorry.  
0
 
Rey Obrero (Capricorn1)Commented:
then, remove the sensitive information...
0
 
cobiannaAuthor Commented:
It's not that easy.  I have several ODBC drivers linked into the db.  I will see if there is a way for me to manipulate those tables with mock data.  It's going to take a while but I will see what I can do.
0
 
Rey Obrero (Capricorn1)Commented:
just use a local table with dummy data
0
 
cobiannaAuthor Commented:
Capricorn1,
It's working now.  I'm not sure what happened but it works.  Thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.