Change text box color on current record ONLY!

B

Ben

I have two text boxes that I want to turn Grey when I click a check box. but
I only want to have that occur on the current record, so when I move to the
next record those text boxes are back to normal. Here is my code so far:

If [Risk] = True Then
[Risk_Probability].BackColor = 12632256
[Impact].BackColor = 12632256
Else
[Risk_Probability].BackColor = 16777215
[Impact].BackColor = 16777215
End If

Please help. Thanks
 
D

Dennis

The easiest way is to put the same code in the On Current event of the form.
If you only want the code once then, put it in a module (with the relevant
changes to acces your forms controls) and then call the function from
clicking your checkbox and from the On Current event of the form.
 
D

Douglas J. Steele

If you're talking about a continous form (or a datasheet form), code like
that will change every text box on the form.

Look into using Conditional Formatting instead.
 

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