Back Color Property in Access 2007

T

Todd C

Hello All;
Not sure if this is the right place for this post, but I did not see any
"Access General Questions"

Here goes:

I am using Access 2007 and trying to set the BackColor property of a text
box on a form using VBA Code in the Form_Open event with code like this:

Me.txtName.BackColor = <some global variable>

Here's the thing: In order to get the correct color numer, I first pick my
desired color from the palette to see its value. In this case, a very bright
red comes up as #ED1C24.

In Access 2003 and earlier, this value would be represented as a long
integer, not a Hex. So, to get the HEX value converted to a long integer, I
use this:

<some global variable> = Clng("&H" & "ED1C24")

which evaluates to 15539236. But when the form opens, the text box comes up
in bright blue, not bright red.

Is something wrong with my Hex to Long conversion? Why did Microsoft change
the BackColor property of form and report objects from long integer
representation to Hex? Is it "ED1C24" even Hex?

This was SOOOOOOO much easier in version 2003!

Please help.
 
T

Todd C

Continuing the saga here:

From On-Line help, I found this concering the BackColor property:

"In Visual Basic for Applications (VBA) code, use a numeric expression to
set this property. This property setting has a data type of Long."

But when you manually choose a color from the palette, you get what LOOKS
like a hexidecimal number, something like #9DDDFD, which is, in fact, a
concatenated representation of the three RGB coordinates 157, 221, and 253,
respectively. Yet if I try to convert the RGB values to LONG and use THAT
number:

me.BackColor = RGB(157, 221, 253)

I STILL get a totally DIFFERENT color.

Why did they make this so difficult? On-Line Help *SAYS* it is supposed to
be a LONG data type, but that is NOT what the design interface is presenting
to me!

Hey Microsoft: Be consistent!

how do I do this?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top