Solved

Need to convert vba 2003 aDialog color picker to html hex

Posted on 2013-11-01
2
537 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 51

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
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 different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

696 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