Problem with Background Color Formating

Jaster_96
03-18-2003, 11:47 AM
Currently I am retrieving my colors from an ADODB recordset

After I retrieve the values from the database I then try the following


lbl.BackColor = ColorVariable


When I run it I error out and get a type mismatch. Any help would be greatly appreciated. Thanks.

GMan_NC
03-18-2003, 11:49 AM
What is the value of ColorVariable?

Jaster_96
03-18-2003, 12:11 PM
What is the value of ColorVariable?

I've tried setting the variable to vbRed, Red and a few Hex Values for Red and it still gives me the error.

GMan_NC
03-18-2003, 12:23 PM
These following examples all work, see which one you could use

Dim ColorVariable As String
ColorVariable = "&HFF"
Label1.BackColor = ColorVariable
'or
Dim ColorVariable As Long
ColorVariable = 255
Label1.BackColor = ColorVariable
'or
Dim ColorVariable As Long
ColorVariable = &HFF
Label1.BackColor = ColorVariable

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum