Conditional Formatting not working in a Form

MsT

New Member
Joined
Mar 17, 2003
Messages
37
I have a form and the conditional formatting does not work consistently.

It’s a columnar form with tabs within it. It was created from a wizard originally and then heavily modified (both the layout of the form and also the underlying query created by the wizard)

When I open the form, the CF does not work. After I open the form in design view, open the underlying query, and close it again, the CF works.

All the CF fields are affected, both those in the form header and those in the tabbed sections.

I originally thought it was linked to the fact that the fields were calculated, but I've tried with simple numerical fields and they are affected too.

Has anyone any suggestions or solutions?

Many, many thanks
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Without being able to look at the form, this is just a guess. I suspect that the cf would work even if you don't open the query, but just switch the form to design and back again. If that's the case, it seems that at the end of the form load event, you need a form method to force recalculation on the controls. I'd try (in this order but one at a time) Me.Recalc, Me.Repaint, Me.Refresh, Me.Requery
Don't do this in the form open event, as the load event occurs afterwards. The recalc method is supposed to be for calculated controls, but I'd consider conditional formatting to be a form of calculation but can't say if that's exactly true.

All assumes that we're not talking about a subform here.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,279
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top