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

Conditional Formatting

I have a mainform with an Object called [parttype’ and a subform form with an object called [DiscPL1] and need to do some conditional formatting on [DiscPL1] if [Partype] file’s value is  like “Extended”.
I am using the “conditional formatting” function in MS Access 2007.  Below is what I have that isn’t working.  
IIF ([Forms]![frmMainForm]![[parttype] Like "Extended",[DiscPL1].BackColor  = #ED1C24)

Could I please get help in getting the [DiscPL1] object to change the back color from blue to red if the condition is meet.  thanks
  • 2
1 Solution
By Like, do you mean containing the word Extended?

- Right-click the DiscPL1 control in design view and select "Conditional formatting..."

- Select "Expression IS " from the drop down list

- Enter the following expression in the textbox provided:

  Instr(1, [Forms]![frmMainForm]![[parttype], "Extended") > 0

Open in new window

- Then select the color you want to see when that condition is met.
If you want part type to exactly match the word "Extended", then use this for your expression instead:

[Forms]![frmMainForm]![[parttype] =  "Extended"

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

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