?
Solved

Need to convert vba 2003 aDialog color picker to html hex

Posted on 2013-11-01
2
Medium Priority
?
542 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 52

Accepted Solution

by:
Rgonzo1971 earned 2000 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

Technology Partners: 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.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
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…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Suggested Courses

762 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