Results 1 to 12 of 12
  1. #1
    edmscan is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    168

    Conditional Formatting not Working unless I Click on Control

    Ok .. so I have a Continuous form that I want a control to have a different background color if it matches a value I enter from a text box.

    The thing .. the form loads with NO data. I then .. enter in values in 4 text boxes. This does not change, always the same.

    I have a button .. which loads the form with the correct data.
    ( I just alter the recordsource in the button .. based on the entered 4 values).

    But the conditional formatting does not happen .. it stays the same, however if I click on the control with my mouse it DOES change color based on the conditional formatting.

    I want the form to be displayed with the conditional formatting once I click the button.

    I see lots on conditional formatting .. but nothing that explains my issue.

    This is definitely not a conditional formatting issue .. as the conditional formatting does work but needs a mouse click to give it focus I assume, then the control background changes.



    Here are a couple of photos that show my issue .. top not working and bottom is the desired result where there is a match.

    I had to edit out some customer data .. but you should get the idea. Oh ... and I cannot just query for the data on the radio I entered .. that would be too easy. The other data is needed for time stamp purposes.



  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    That doesn't happen in my dBs...


    What is the rule for the conditional formatting?

    Or it might be easier if you posted the dB for analysis. Maybe have 10 - 15 records - use fake data.
    Do a "Compact & Repair", then Zip it.

  3. #3
    edmscan is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    168
    It is .. value equals to txtRadio. It does change color .. so it is not the rule itself.

    I cannot post it .. as the DB is 10 GB in size. If I get no answers on here, I will see what I can do to fake it and post a file. But it is very basic with only 1 rule.
    I would prefer to change the background of the whole line .. but this is fine.

    Don't know if it matters but the top 'radio' control on the data portion of the screen is where the focus is .. once the button is pressed.

  4. #4
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Access has a file size limit of 2 GB...how do you making one that is 10 GB in size?

    Linq ;0)>

  5. #5
    edmscan is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    168
    5 files ... ;-) Right now .. on the 4th file, and about 50 million records.

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Have you tried putting a Me.Repaint or Me.Refresh in the code of your button?

  7. #7
    edmscan is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    168
    Yes .. no difference.

    I made a fake database to demonstrate the issue.

    All you have to do in the attached database is click the button.
    The records that match the radio entered (3679) I want to highlight in orange with white text.

    It does not appear complicated .. but I am not that familiar with Conditional Formatting and it could be something simple.

    Test.zip
    Last edited by edmscan; 11-25-2016 at 05:58 PM.

  8. #8
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I threw together this demo.... without knowing the code behind the button on your form (or seeing your dB), cannot do much more. No code used (except to set the focus to the control "txtRadio".

    Be aware that "Date", "Time", "Type" and "Description" are reserved words in Access and shouldn't be used as object names. (If you are using them as field names).


    Edit: I just found your test dB.....
    Attached Files Attached Files

  9. #9
    edmscan is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    168
    Steve .. no Oops needed. Your method works just fine and my form is working as it should. I just need to pretty it a bit.

    Well .. it worked for about 15 min. It is now broken again with the exact same issue. I am interested in your comments on my test db.

    I found my issue .. when I made the background transparent I can no longer see that it is highlighted. Smiles. This one is done.

  10. #10
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    OK, this is a simple fix.

    The Back Style property of the control "Radio" is set to Transparent. Change it to NORMAL. Change the value of txtRadio to test the conditional formatting..

    Also, on the DATA tab, you can set these properties (if you want):
    ENABLED = NO and
    LOCKED = YES



    I see I am using 'Type' .. but it has not caused me any issues.
    Yes, but it could. And when you least expect it.
    Besides "Type", you also have "Group", "Name" and "User".... all reserved words...

  11. #11
    edmscan is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    168
    Too funny .. we found the same thing at the same time. Thanks for all your help.

    With a little conditional formatting magic .. it is perfect now. Super happy on this one.

  12. #12
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Great minds think alike!!
    Good luck with your project...



    Edited.....

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 10-15-2015, 11:46 AM
  2. Conditional Formatting Not Working Properly
    By davidmcleod in forum Access
    Replies: 14
    Last Post: 06-25-2015, 11:04 AM
  3. conditional formatting or control source?
    By Rujahin in forum Reports
    Replies: 3
    Last Post: 04-08-2014, 03:37 PM
  4. Conditional Formatting not working properly
    By GraeagleBill in forum Reports
    Replies: 3
    Last Post: 03-08-2014, 07:21 PM
  5. Replies: 5
    Last Post: 03-14-2012, 08:32 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