Change text box color on current record ONLY!

  • Thread starter Thread starter Ben
  • Start date Start date
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
 
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.
 
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.
 
Back
Top