[AccessD] Is there a simpler way?

John Colby jwcolby at gmail.com
Tue Jul 12 19:02:05 CDT 2022


LOL Stuart you're a hoot.  This is my first rodeo with HTML.  I have
intentionally avoided it because it is an area of expertise all its own and
I didn't want to get dragged into doing web sites. I will learn just enough
to deal with this thing and move on.

I found that the color tags could deal with a handful of color names in
quotes, and stopped there.

At any rate, your function is in and functioning.

Thanks!

On Tue, Jul 12, 2022 at 7:15 PM Stuart McLachlan <stuart at lexacorp.com.pg>
wrote:

> What? You mean you want HTML to be VBA compliant?
>
> Here's a little function I've just written for you :)
>
> Function HTMLColour(VBAColor As Long) As String
> HTMLColour = "#" & Right$("000000" & Hex$(VBAColor), 6)
> End Function
>
>
>
>
> On 12 Jul 2022 at 18:45, John Colby wrote:
>
> > I need a text enum (colors to be specific).  Enums are longs.  Sigh
> >
> > Public Enum enumVBColors
> >     Black = vbBlack
> >     Red = vbRed
> >     Green = vbGreen
> >     Yellow = vbYellow
> >     Blue = vbBlue
> >     Magenta = vbMagenta
> >     Cyan = vbCyan
> >     White = vbWhite
> > End Enum
> >
> > Function fColor(intColor As enumVBColors) As String
> >     Select Case intColor
> >     Case enumVBColors.Black
> >         fColor = "Black"
> >     Case enumVBColors.Blue
> >         fColor = "Blue"
> >     Case enumVBColors.Cyan
> >         fColor = "Cyan"
> >     Case enumVBColors.Green
> >         fColor = "Green"
> >     Case enumVBColors.Magenta
> >         fColor = "Magenta"
> >     Case enumVBColors.Red
> >         fColor = "Red"
> >     Case enumVBColors.White
> >         fColor = "White"
> >     Case enumVBColors.Yellow
> >         fColor = "Yellow"
> >     End Select
> > End Function
> >
> > Does the trick but DAMN!  I can use these text strings as colors in
> > the HTML tags.  But DAMN!  I hate ugly and this is just ugly.
> >
> > Let the slappin' commence.
> >
> > --
> > John W. Colby
> > Colby Consulting
> > --
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > https://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> >
>
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> https://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>


-- 
John W. Colby
Colby Consulting


More information about the AccessD mailing list