Another Access 2007 Issue – Back Color values not working in code…

I continue to be disappointed with Access 2007 from a Developer’s point of view.  Here is my most recent issue: 

I’m attempting to set the backcolor property of a text box control using the ‘On Format’ event property of a report’s detail section.  I’ve been doing this sort of stuff for 10 years.

I want the backcolor to be green.  When setting this property from the ‘…’ choice in properties, the resulting value is ‘#22B14C’.  Note that I’m totally surprised by such a bizarre value as I’ve only gotten Long Integer values in the past.

Well, when I go to code to set the backcolor value:  txtConditional.backcolor = #22B14C, I get an error indicating that value can’t begin with a ‘#’ sign.  So I go ahead and wrap the value in double quotes: “#22B14C”.  I don’t get an error in code.

I choose the ‘View’ choice in the upper left hand corner of the report’s design view and it previews successfully.  Some of my rows are green, and some are red.  However, when I go to ‘print preview’ (btw, what the heck is the ‘View’ choice for, then?) I get an error telling me that the “#22B14C” value is incorrect.

Well that’s just great!  So now, I’ve got to go Google and figure out how to properly set this value.

 Conclusion:  Microsoft changed everything around like item above, and didn’t test, and didn’t take into account the thousands of experienced Access Developers.  More to come!

Jack Jaeger

President Data Control, LLC and

15 year Access Veteran

This entry was posted in Access 2007 problems/solutions. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *