Wierd Conditional Formatting error

laughingdevil

New Member
Joined
Aug 5, 2011
Messages
40
Hi, hopefully someone can shed some light on this.

I have a form in Access 2002 with about 20 text boxes with data from a table. I have conditional formatting set up on several of them so.

One of the boxes has this format set

"[POPFLAG]<>0 And [diagpopcount]>0"

Popflag is another box, and diagpopcount is the box in question, the formatting is supposed to turn it red if the pop flag box contains anything other than 0 and the diagpopcount is >0.

If I load the form with popflag =0, then change it to 1 this works fine. However If I load the form with popflag =1 then the formatting is not applied (there is no other format applied to the box) and I've no idea why.

To make things more wierd if I apply this format to another box, not only does it work correctly on that box, but the formatting on the diagpopcount box starts working too!

Currently I have a workaround where I have the clause on another box set to do nothing, however I may need to put more formatting on this in future so don't want to "eat up" my format count, and also I don't like having this code sat around when it shouldn't be needed.

Any assistance would be appreciated.
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Try putting this in the after update event for the popflag control:
Code:
me.requery

Alan
 
Upvote 0
Not quite sure what you mean.

I'm not doing the conditional formatting in VB, just in the normal format>conditional formatting, not sure where you'd put me.requery their.

I have tried sticking that in the forms "on open" code, but this doesn't work either.
 
Upvote 0
Note : I have another text box called Pop2Count, which has exactly the same conditional formatting statement as Diagpopcount, which works on open.
 
Upvote 0
Open your form in design view. Right click on the popflag textbox. Click on Properties. Click on the After Update on the Event tab. Insert the code there.

Alan
 
Upvote 0

Forum statistics

Threads
1,226,730
Messages
6,192,702
Members
453,748
Latest member
akhtarf3

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