Solved

Need to convert vba 2003 aDialog color picker to html hex

Posted on 2013-11-01
2
524 Views
Last Modified: 2013-11-01
Hi,

I'm using Access 2003 and I want to use the aDialogColor picker that I've installed into my project to select a color which will change the textbox contents on my form.  Then I wnat to convert that value (me.textbox.forecolor) to html hex format when I build a html page, ie. <font color="&xxxxxx">, where "xxxxxx" is the converted hex number.

Any ideas?

Thanks.
0
Comment
Question by:ajadams1
2 Comments
 
LVL 50

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 39616696
Hi,

pls try

Public Function getRGB(lngColor As Long) As String
    Dim lngRed As Long, lngGreen As Long, lngBlue As Long
    lngRed = lngColor And vbRed
    lngGreen = (lngColor And vbGreen) \ &H100
    lngBlue = (lngColor And vbBlue) \ &H10000
    getRGB = Format(Hex(lngRed), "00") & Format(Hex(lngGreen), "00") & Format(Hex(lngBlue), "00")
End Function

Open in new window

Regards
0
 

Author Comment

by:ajadams1
ID: 39616956
Yes!  That works perfectly and no need to add additional code into the form.

Andrew
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question