Conditional Formatting on a combo-box in a form (1 Viewer)

wire_jp

Registered User.
Local time
Today, 12:56
Joined
Jun 23, 2014
Messages
64
Hi Everyone,

I am using Microsoft Access 2013. There is a combo-box in a split-form called "FollowUp" and it contains two values: - "Follow-up 1" and "Follow-up 2". I will like to apply conditional formatting on this combo-box, such that if a user selects the value of "Follow-up 1" from the combo-box, then this value is recorded in the combo-box. However, if the user selects the value of "Follow-up 2" from the combo-box, then the combo-box will change color to Red and show a message which states "See John Brown".

I have been able to apply conditional formatting to the combo-box so that if a user either (i) selects the value "Follow-up 1", then this "Follow-up 1" value will populate the combo-box or (ii) if the user selects the value "Follow-up 2", then the value "Follow-up" 2 will populate the combo-box and the combo-box turns red. However, I am not able to create the expected action where if the user selects the value "Follow-up 2" from the combo-box, then the combo-box will change color to Red and show a message which states "See John Brown".

Your help will be greatly appreciated.

Thanks,

wire_jp
 

Fijian

Registered User.
Local time
Today, 20:56
Joined
Sep 22, 2005
Messages
32
This is what you can do. Very simple.

Create a AfterUpdate command (assuming your Combo name is "Combo2"

Private Sub Combo2_AfterUpdate()
If [Combo2] = "Follow-up 2" Then

Me.Combo2.Value = "See John Brown"
Me.Combo2.BackColor = 2366701

Else
'Leave the back color as White
Me.Combo2.BackColor = 16777215

End If


End Sub
 

wire_jp

Registered User.
Local time
Today, 12:56
Joined
Jun 23, 2014
Messages
64
Hi Fijian,
Your solution works perfect! Thank you very much for your help.

Cheers,

wire_jp
 

Users who are viewing this thread

Top Bottom