Solved

Need to convert vba 2003 aDialog color picker to html hex

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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

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…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

737 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