Access conditional formatting based on unbound combobox

etech0 used Ask the Experts™

I have an access form with a subform that's a datasheet.

On the main form, there is a combobox which I use to change views. Changing the combobox changes which records show in the datasheet subform (by using VBA to change the SQL).

I also have conditional formatting in the subform, to change the color of certain records.

Here's what I'm trying to do, and can't figure out how:
My users want me to set the conditional formatting logic so that when the combobox on the main form is set to a certain value, different records get their color changed.

I've set up the logic in the conditional formatting box, but it does not work properly. I also noticed that it treats the name of the combobox like a field (by putting brackets around it) - maybe that's the problem?

I know my logic is okay, because I tried it out in the immediate window.

Am I doing something wrong?

Here is my expression in case it helps
([TicklerDate]>Date()) Or (([Location]<>getuser()) And ([me].[parent].[filtercombo]=8))

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2012
Top Expert 2013
I believe you need to use the full form reference in the Conditional Formatting window.

"Me" is a VBA identifier, and does not work in queries, property sheets, etc  -- just in the VBA editor.

([TicklerDate]>Date()) Or (([Location]<>getuser()) And (Forms!YourMainFormName!filtercombo=8))

Open in new window


That did the trick. Thanks - I was going crazy from this!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial