Here is how I set BackColor:
.tbxRice.BackColor = RGB(204, 255, 204)
.tbx611ac.BackColor = vbWhite
Whether using VBA or Conditional Formatting, make sure BackStyle is set to Normal.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
June brings up a good point that the behavior you are experiencing should not be happening. I use VBA and don't use intrinsic conditional formatting. My impression is the report does not understand the value of the calc in a timely manner and can not format appropriately. This may explain the need to click and set focus in report view to see correct results.
This attached DB displays examples of calcs and formatting using VBA.
I just reviewed post 7 and have to say the IIf expression is unconventional. Is that an expression in a textbox? It might represent the logic you want to apply, but AFAIK setting a property that way cannot be possible.
If you want to provide your db for analysis, follow instructions at bottom of my post.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
It's interesting that the conditional formatting only appears in Print Preview, but not Report View. I am going to work on this tonight and see if I can adapt the input and examples to get what I am trying to produce. I appreciate very much the assistance you two have offered!! I'll post my results this evening or tomorrow.Thanks!!
Got it to work. And...I'm a bit embarrassed about what the issue was...I had used format painter from another cell...which had the Conditional Formatting from the ribbon button included. So there were 2 sets of instructions competing with each other. It suddenly hit me that I used Format Painter when I looked at the icon. I opened it up and sure enough...4 flippin' rules. Grrr. LOL. So, it's working now. Much thanks folks!!![]()
Glad you were able to find the issue. One of the reasons I use a lot of VBA is so I can easily see and find out why the application behaves a certain way. In other words, I have been through similar scenarios myself. So don't be embarrassed.