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
PI_Adj.Visible = True
End If

Open in new window

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rey Obrero (Capricorn1)Commented:
so, you have a continuous form.
you have to bind the checkbox to a yesno field in your table.
cobiannaAuthor Commented:
Actually, it's a single form.  I am pulling the check box from a yes/no field in my table.
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()


end sub

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

cobiannaAuthor Commented:
I tried that.  I'm still having the same issue.
Rey Obrero (Capricorn1)Commented:
can you attach your db?
cobiannaAuthor Commented:
I can't.  It contains sensitive information.  Sorry.  
Rey Obrero (Capricorn1)Commented:
then, remove the sensitive information...
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.
Rey Obrero (Capricorn1)Commented:
just use a local table with dummy data
cobiannaAuthor Commented:
It's working now.  I'm not sure what happened but it works.  Thanks.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.