What-ho,
Here's an example code snippet:
Get a form and put seven text boxes on it, called text1 to text7.
Now, put this into your form_load event:
Me.BackColor = RGB(170, 170, 255)
Me.Text1.Text = Hex(Me.BackColor)
Me.Text4.Text = Mid(Right(Me.Text1.Text, 2), 1, 2)
Me.Text3.Text = Mid(Right(Me.Text1.Text, 4), 1, 2)
Me.Text2.Text = IIf(Len(Mid(Right(Me.Text1.Text, 6), 1, 2)) < 2, _
"0" & Mid(Right(Me.Text1.Text, 6), 1, 2), _
Mid(Right(Me.Text1.Text, 6), 1, 2))
Me.Text5.Text = CStr(Val("&H" & Text2.Text))
Me.Text6.Text = CStr(Val("&H" & Text3.Text))
Me.Text7.Text = CStr(Val("&H" & Text4.Text))
This sort of goes through thew whole process of first setting your form.backcolor using the RGB() function and then retrieving it, converting it from the long format the property returns as to hex, reliably splitting the long into three two byte hex values and then converting these into decimal values.
So there you have it, decimal to hex to decimal in only, erm, about a million easy steps...
Cheerio,
Paul
[sig][/sig]