Solved

Need to convert vba 2003 aDialog color picker to html hex

Posted on 2013-11-01
2
486 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 48

Accepted Solution

by:
Rgonzo1971 earned 500 total points
Comment Utility
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
Comment Utility
Yes!  That works perfectly and no need to add additional code into the form.

Andrew
0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
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 …

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now