• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 933
  • Last Modified:

Access conditional formatting based on unbound combobox

Hi!

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))

Thanks!
0
etech0
Asked:
etech0
1 Solution
 
mbizupCommented:
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

0
 
etech0Author Commented:
That did the trick. Thanks - I was going crazy from this!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now