Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cell Background Color Change

Status
Not open for further replies.

jbento

Technical User
Jul 20, 2001
573
US
All,
I have a radio button, I would like to click and when clicked, I would like for the background color of the field: text1, to change to yellow.

This is on a form that is in Continuous view.

I have the following code associated with the OnClick of the radio button: Me.text1.BackColor = vbYellow, but it changes every record to yellow.

I only want the active record field to be changed to yellow.

How can I accomplish this?

Any help will be really appreciated.

Thanks in advance,

Jerome Benton
JERPAT Web Designs
GOD Is Good All The Time!!!
 
To expand on what I have posted:

If Check12.Value = True Then
Me.text1.BackColor = vbYellow
End If

If Check12.Value = False Then
Me.text1.BackColor = Transparent
End If

I also need to know what is the correct syntax for making the color transparent?

Jerome Benton
JERPAT Web Designs
GOD Is Good All The Time!!!
 
I guess the correct syntax would be vbWhite:)

I still need help with this part of the thread:

I have a radio button, I would like to click and when clicked, I would like for the background color of the field: text1, to change to yellow.

This is on a form that is in Continuous view.

I have the following code associated with the OnClick of the radio button:

If Check12.Value = True Then
Me.text1.BackColor = vbYellow
End If

If Check12.Value = False Then
Me.text1.BackColor = vbWhite
End If


I only want the active record field to be changed to yellow.

How can I accomplish this?


Jerome Benton
JERPAT Web Designs
GOD Is Good All The Time!!!
 
Instead of doing this with code, why not use conditional formatting. Set the conditional format of the text box to;

"Expression is" "check12.Value=True" Choose Yellow as your color.

If you are not familiar with conditional formatting; click in the text box that you want to alter colors, click format/conditional formatting. From here just set the condition as mentioned above.

Good luck
Rob
 
Because it's in a continuous form you have to use conditional formatting. The controls in a continuous form are not standard textboxes and such, and are not standard windows, therefore standard methods will not work. The only way to accomplish your goal is through conditional formatting.

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
I figured as much on the conditional formatting.

I will try a different approach with conditional formatting today.

Thank you all for responding and have a BLESSED day.

Jerome Benton
JERPAT Web Designs
GOD Is Good All The Time!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top