Conditional Formatting based on drop down list (1 Viewer)

yankeefan1972

New member
Local time
Yesterday, 20:17
Joined
Jan 14, 2013
Messages
7
I'm trying to make a field become highlighted if a certain item is picked from a drop down list. For example if Other is chosen, another field named Other? becomes highlighted. I have tried it in conditional formatting, using Expression is [Field Name] = "Other" but it doesn't work when I choose Other. Any help?
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 17:17
Joined
Aug 30, 2003
Messages
36,125
If it's a dropdown, is the bound column perhaps an ID number rather than the text "Other"?
 

yankeefan1972

New member
Local time
Yesterday, 20:17
Joined
Jan 14, 2013
Messages
7
How do find out if the bound column is an ID number?? Also if it is, can I put that number in the expression?
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 17:17
Joined
Aug 30, 2003
Messages
36,125
Check the row source and bound column properties of the combo. Yes, you can use the number in the expression.
 

yankeefan1972

New member
Local time
Yesterday, 20:17
Joined
Jan 14, 2013
Messages
7
The Bound Column says 1 and the Row Source has all the options in it. How do I know which option will have what "ID".....sorry for the confusion.
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 17:17
Joined
Aug 30, 2003
Messages
36,125
Whatever is in the first column of the row source is the value the Conditional Formatting expression is looking for. Can you post the db here if you're still stuck?
 

yankeefan1972

New member
Local time
Yesterday, 20:17
Joined
Jan 14, 2013
Messages
7
Unfortunately I cannot post the DB. I'll explain again and maybe you can show me the expression I should use. I created a combobox through the lookup wizard when creating my table. It has 12 values in it. The last one is "Other". In the related form, I want the text box of the field "Other?" to be highlighted yellow, so that the user will fill it out. I went into conditional formatting and used an expression that read: [Field Name] = "Other". This did not work when I populated the combobox with Other, when selecting it from the list.

I don't understand when you say "whatever is in the first column of the row source" When I go to properties for the lookup in the field...the "row source" is populated with the 12 options I typed in. Am I looking in the wrong place?? I am an amateur Access user trying to figure it out.
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 17:17
Joined
Aug 30, 2003
Messages
36,125
So the combo is a value list where you just typed in 12 values? I was assuming a table or query. That would mean it only has one column, so "Other" should work fine. I assume you used the actual name of the field that stores that value?
 

yankeefan1972

New member
Local time
Yesterday, 20:17
Joined
Jan 14, 2013
Messages
7
:banghead:Yes I typed it correctly. I have played around with it and if it's not part of a list then it works.........???? I am assuming that my expression is wrong.
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 17:17
Joined
Aug 30, 2003
Messages
36,125
I don't see anything wrong. Can you post just a sample db that exhibits this problem?
 

yankeefan1972

New member
Local time
Yesterday, 20:17
Joined
Jan 14, 2013
Messages
7
I think it doesn't work, because I am allowing multiple values be chosen in my drop down list...could that be, and is there and expression that would account for that? i.e. If multiple choices are made, that if one of them is Other, than the Other field is highlighted?
 
Last edited:

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 17:17
Joined
Aug 30, 2003
Messages
36,125
That is certainly possible, even likely. I don't like and haven't used the new multivalue field/combo. You might try using InStr() to see if Other is contained in the result, as I think it stores values as a string: option1, option5, other
 

Users who are viewing this thread

Top Bottom