By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,657 Members | 1,682 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,657 IT Pros & Developers. It's quick & easy.

Adding additional Conditions to Conditional Formatting

P: 6
Hello,

I have a text box (on a Single Form) that I use to color code milestones based on a value. I use the “Conditional Formatting” tool to format four of the conditions, which works great! Unfortunately, I need an additional two conditions for a total of six.

I believe the additional two conditions must be created by using code to accomplish what I need, but I do not have a whole lot of knowledge in coding. I am wondering if someone can assist me with creating the last two conditions.

I need a text box (txtbox_status) to turn “Green” when I enter the number “5” in the text box and “Pink” when I enter the number 6.

Appreciate any help I can get.
Oct 9 '08 #1
Share this Question
Share on Google+
1 Reply


puppydogbuddy
Expert 100+
P: 1,923
I need a text box (txtbox_status) to turn “Green” when I enter the number “5” in the text box and “Pink” when I enter the number 6.
Expand|Select|Wrap|Line Numbers
  1. Private Sub txtbox_status_Change()
  2.  
  3. If Me.txtbox_status.Value = 5 Then
  4.         Me.txtbox_status.BackColor = vbGreen
  5. ElseIf Me.txtbox_status.Value = 6 Then
  6.         Me.txtbox_status.BackColor = vbPink   ' <<try vbCyan or vbMagenta if pink not recognized
  7. End If
  8. End Sub
Oct 9 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.