Page 2 of 2 FirstFirst 12
Results 16 to 22 of 22
  1. #16
    Twitchie is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2014
    Posts
    20

    So, with it at least calculating in Print Preview, I tried to add the formatting bit, but the coloring doesn't appear in Print Preview or Report View. Here's my most recent VBA on it:
    Click image for larger version. 

Name:	VBA 3.png 
Views:	6 
Size:	15.5 KB 
ID:	15701

  2. #17
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    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.

  3. #18
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    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.
    Attached Files Attached Files

  4. #19
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    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.

  5. #20
    Twitchie is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2014
    Posts
    20
    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!!

  6. #21
    Twitchie is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2014
    Posts
    20
    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!!

  7. #22
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    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.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 6
    Last Post: 05-26-2013, 09:10 PM
  2. Conditional Formatting
    By riaarora in forum Access
    Replies: 6
    Last Post: 09-03-2012, 05:58 AM
  3. Conditional Formatting
    By Desstro in forum Programming
    Replies: 3
    Last Post: 12-01-2010, 09:52 PM
  4. Conditional Formatting
    By DanOzDirect in forum Reports
    Replies: 3
    Last Post: 07-21-2010, 08:49 PM
  5. Conditional formatting
    By ylivne in forum Reports
    Replies: 1
    Last Post: 07-12-2009, 06:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums