Access conditional formatting based on unbound combobox

Posted on 2012-08-21
Last Modified: 2012-08-21

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

Question by:etech0
    LVL 61

    Accepted Solution

    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

    LVL 10

    Author Closing Comment

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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
    Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
    Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
    Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now